Fix #162 Avoid multiple reconnection attempts when WebSocket throws errors