Setting __connected to False on connection close