SPARK-1032. If Yarn app fails before registering, app master stays aroun...

...d long after.

Verified this on a pseudo-distributed cluster.