Fix memory leaks when uninstalling OSGi bundles.