Abandon attempts to add locking to set/clear outputs and enable/disable guider. The problem is that the acquire() is in the calling thread, and the release() in a callback later is in the motor controller thread - and that thread never acquired the lock.