[addons] ensure we exit the lock prior to calling PrunePackageCache() as this takes ages, and will grab graphicscontext lock, leading to deadlocks