[SPARK-3627] - [yarn] - fix exit code and final status reporting to RM

See the description and whats handled in the jira comment: https://issues.apache.org/jira/browse/SPARK-3627?focusedCommentId=14150013&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14150013

This does not handle yarn client mode reporting of the driver to the AM.   I think that should be handled when we make it an unmanaged AM.

This config should use camel case for `applicationMaster`. Also, there's already a `spark.yarn.applicationMaster.waitTries`. Does the extra `client` mean it's for client mode? Do we want a separate setting for client vs deploy modes here?

By the way there is a mismatch between what is already there `spark.yarn.ApplicationMatser.waitTries` and what we document `spark.yarn.applicationMaster.waitTries`. I think this is a bug that we can fix separately.