+ * always set controlled mode to false when unregistering the last client.
+ fixes 30 second timeout before controlled mode gets deactivated
+ * updated the cached device type setting properly when persisting new
+ settings. correct return value from WriteEEPROM(). lock a mutex when
+ updating the state