SPARK-4454 Fix race condition in DAGScheduler