The th_task_state was initialized from the master thread's value, or from its memo stack, but this causes problems because neither of those may have the right value at the right time. However, other threads in the team are guaranteed to have the right values, so we change the initialize the new threads' th_task_state from the th_task_state of the last of the older threads in the hot team.
Fix #56307.