Close websocket when app is finished