Close websocket when browser is closed.