Restructure internal connection closing to address #275

- split up the _on_connection_closed method, creating an _on_disconnect method
- Have the heartbeat checker call _on_disconnect once it disconnects the broker