[SPARK-3571] Spark standalone cluster mode doesn't work.

I think, this issue is caused by #1106
If we use numWorkersVisited and numWorkersAlive,  numWorkersVisited is set to 0 before entering while loop even though still in for loop.
If it's still in for loop and last visited index is N, the index of a worker which is to be visited next should be N+1.