Don't call System.exit over uncaught exceptions from shutdown hooks

Currently, spark.executor.Executor's uncaught exception handler always tries to call System.exit(). Unfortunately, calling System.exit() from a shutdown hook deadlocks. This patch modifies the uncaught exception handler to avoid calling System.exit() when a shutdown is in progress.

This also modifies the delete local directories shutdown hook to catch and log exceptions, which is how I noticed the deadlock.