Can't reconnect issue

Fix https://github.com/palmerc/SecureWebSockets/issues/5 and a NPE