sched: Fix race in task_group()