Add JVM shutdown hook