closing websocket on socket I/O errors