[YARN][SPARK-4929] Bug fix: fix the yarn-client code to support HA

Nowadays, yarn-client will exit directly when the HA change happens no matter how many times the am should retry.
The reason may be that the default final status only considerred the sys.exit, and the yarn-client HA cann't benefit from this.
So we should distinct the default final status between client and cluster, because the SUCCEEDED status may cause the HA failed in client mode and UNDEFINED may cause the error reporter in cluster when using sys.exit.
can we clarify this comment a little.  Perhaps something more like below (feel free to reword)

Set the default final application status for client mode to UNDEFINED to handle if YARN HA restarts the application so that it properly retries. Set the final status to SUCCEEDED in cluster mode to handle if the user calls System.exit from the application code.