[SPARK-2567] Resubmitted stage sometimes remains as active stage in the web UI

Moved the line which post SparkListenerStageSubmitted to the back of check of tasks size and serializability.