Improved robustness in thread_state cleanup so that it works even if something manages to destruct the thread object too early. Rev: src/threads.c:1.261 Rev: src/threads.h:1.134