Disconnect socket when closing visualization