python: samba.gensec: Port module to Python 3 compatible form