Shutdown cleanly when the driver is stopped.

there might be other states that return nil (maybe error could directly for instance) so i put it at the end of the state loop in Run instead.