RemoveStageBarrier: handle failed task in a synchronized manner