Fixed issue: impossible to reconnect

We test if the socket is not null and connected but not if it's closed. This problem was saw before and the method "isConnected()" from WebSocketConnection add it.

This issue was report (by inspire580i) on the original library: https://github.com/palmerc/SecureWebSockets/issues/5
Fixed NullPointerException

Occur when we want to disconnect by ourself when the library notify about a closing connection
Fixed dependency