fix NullPointerException in WebSocketClient

in some cases, if the connection was not successfully created the 'conn' will be null, but method invoked without checking.