[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.

The reason I swallowed it was to return the exit code I explicitly set.  It doesn't matter to much as re-throwing with exit with 1 but its a little nicer to have the exit code.  We probably shouldn't be swallowing errors or perhaps scala !NonFatal though.