samba_tool: make exception handling statements py2/py3 compatible