Don't send packet if the connection isn't connected. Also, set connected to false in CloseThread for good measure