Prevent attempting to disconnect while disconnecting.

This could happen if the disconnect put us in a state such that the write thread hit a send error and then disconnect was called again, which would then cause problems in the react Signal notification.