Only ensure socket keep alive if socket exists

This is irrelevant if you're connecting via WebSockets, and causes an
error.
Emit data from new connection to the callback.

This allows the callback function to get access to the JID data.
Show that online cb gets passed the data object
Merge pull request #48 from jackfranklin/master

Couple of minor tweaks