re-enable commented out shutdown hook if no OSGi

When we are running standalone, out of an OSGi framework, we
need the shutdown hook functionality.