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

Same question about `Thread.interrupt()`.

Also, might be useful to check if the thread is alive before trying to interrupt it; although it's probably ok the way it is in your current code. (I was mostly thinking about log messages but it seems all of them are `logDebug`.)