tttocea608: clean up locking
Locking order of state and settings was inconsistent, and causing deadlocks. Fix and document it, consistently drop locks before chaining up events / pushing and avoid sequentially unlocking / relocking settings in the same local code path.