Added keep-alive thread

Ping-pong seemed to have some issues, so I came up with this workaround