fix a shutdown sequencing bug that was preventing the JVM from exiting.