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