Disconnect the connection if we are existing early.

Closes #245.