RemoveStageBarrier: compute sorted task sets without holding a lock on TaskSchedulerImpl