Move deleting thread on TARGET_WAITKIND_THREAD_EXITED to core