Update WebSocket.js

Fixed issue https://github.com/einaros/ws/issues/246.

The occurred error with reason "invalid error code" crashes program execution. This patch helps to fix this problem.