[SPARK-2947] DAGScheduler resubmit the stage into an infinite loop

@rxin  Because there is no cancel running tasks in the stage. `stage.pendingTasks.contains(task)`  is necessary.