Wait for OSGi framework to stop before trying to delete its cache.