Fix memory leak in websocket server