Python gatekeeper, message no longer leave sockets in TIME_WAIT state

This commit incorporates Rok's python gatekeeper. Furthermore, it fixes issues where sockets closed are left in TIME_WAIT state, even for very short messages. This is acceptable in our case, since we have control of the network and do not need to worry about routers causing packets to get delayed.