App dies if socket disconnects between onConnect and emitting the 'connect' message

```js
if (this.readyState != WebSocket.OPEN) {
    if (typeof cb == 'function') cb(new Error('not opened'));
    else throw new Error('not opened');
    return;
  }
```

For some strange reason some times, the client socket will receive the onConnect method but will disconnect just before emitting the `connect` message, so with the above exception, the app will die!