[SPARK-2165] spark on yarn: add support for setting maxAppAttempts in the ApplicationSubmissionContext

I see, our client only submits it once, but it's up to the RM how many attempts it makes to set up state for the application or launch the AM container etc. (The docs at https://hadoop.apache.org/docs/current/api/org/apache/hadoop/yarn/api/records/ApplicationSubmissionContext.html#setMaxAppAttempts(int) are pretty misleading...)

Then maybe it makes sense to call this `spark.yarn.application.rmMaxAttempts` or something?