[KARAF-2694]NPE when use osgi:uninstall
(cherry picked from commit 6817efe60df82a385416c4c29c05c400954e9840)