Shutdown cleanly when the driver is stopped.

the event channel is closed by the state machine exiting only. I added this here so that if we want to do things like reregister we can do it using the closed channels while in state ready as you suggest. i'd rather add that in a followup.