Added shutdown hooks for non-OSGi plugins.