Fix in isConnected() of WebSocketConnection

Added a check for a closed socket