[SPARK-2298] Encode stage attempt in SparkListener & UI.

This turned out to be much tricker than I thought. It is still work in progress, since failed stages don't get reported properly yet. Also probably fails the JSON protocol test since I didn't update the protocol.



this is a nit, but I think this method might be better as an updateStageInfo(numTasks: Int) method in Stage(), that creates an appropriate StageInfo and then sets latestInfo accordingly (since I think that would make it a little clearer to a reader what the usage of this is). Fine if you think it's better this way though...