Threads: Mutex()->lock() needs to survive cleanup on exit. In some cases lfun::destroy() calls lock() in a mutex. If this happens during cleanup on exit phase, Pike_interpreter.thread_state->thread_obj is already NULL.