Added ability to wait for correct shutdown

Hi

I'd really like to know when the connection to the cluster is finally shut down. The easiest and most go-like way seems to me to close the event channel.

Regards
Hannes