[SPARK-4787] Stop context properly if an exception occurs during DAGScheduler initialization.