Add ability to send periodic keepalive messages to a topic
Ensure _cleanUp is called when socket closed unexpectedly