Shutdown cleanly when the driver is stopped.

This should likely go to stateRegister.  There is currently nothing that closes the event channel (or I'm blind?), possibly send() can close the events channel on error to indicate that a re-registration should be triggered?