tests/unix_sockets: Fix string writing with python 2.7