Fix in isConnected() of WebSocketConnection

Added a check for a closed socket
Merge pull request #3 from kgusak/master

HeartBeat thread will never finish