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

Determines whether a task is present in `stage.pendingTasks`, This avoids the issue of the above said