Fix race during freezing of TASK_STOPPED task