Threads: this_thread() needs to survive cleanup on exit. There apparently are some lfun::destroy() that call this_thread() at a time when Pike_interpreter.thread_state->thread_obj is NULL.