Fix resource leaks in WebSocketServerProtocolHandler

- Related: #1975