Fixed bugs where the _disable_threads lock could fail to hold the
threads if there are threads dependent on uid or similar running when
the _disable_threads lock is requested. This bug could cause numerous
"Cannot wait for mutexes/conditions when threads are disabled"
backtraces when _disable_threads is used (e.g. through the Privs class
in Roxen). Cf [bug 1173 (#1173)].