websocket: fix some leaks