Fixes for closing a connection in the response of a websocket_connect