tdf#159790 eliminate deadlock on main thread

A separate thread may have already acquired m_aMutex and that
thread will then try to acquire the solar mutex. However, when
the main thread calls this method, the main thread has already
acquired the solar mutex.

So, drop the desktop mutex before calling out.

Change-Id: Ic87063266ac5101b866df9f24067a403e1417745
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165682
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 89e23bb599104d3bde30878148e15cf4deb1593f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165710
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index 6228142..ceba81f 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -654,7 +654,7 @@ OUString replaceOrigin(


void BackendImpl::PackageImpl::processPackage_(
    ::osl::ResettableMutexGuard &,
    ::osl::ResettableMutexGuard & guard,
    bool doRegisterPackage,
    bool startup,
    ::rtl::Reference<AbortChannel> const &,
@@ -689,7 +689,10 @@ void BackendImpl::PackageImpl::processPackage_(
            if ((that->m_eContext != Context::Bundled && !startup)
                 || comphelper::LibreOfficeKit::isActive())
            {
                if (m_isSchema)
                bool bIsSchema = m_isSchema;
                // tdf#159790 prevent lock-ordering deadlock, the code below might acquire the solar mutex
                guard.clear();
                if (bIsSchema)
                {
                    css::configuration::Update::get(
                        that->m_xComponentContext)->insertExtensionXcsFile(
@@ -701,6 +704,7 @@ void BackendImpl::PackageImpl::processPackage_(
                        that->m_xComponentContext)->insertExtensionXcuFile(
                            that->m_eContext == Context::Shared, expandUnoRcUrl(url));
                }
                guard.reset();
            }
            that->addToConfigmgrIni( m_isSchema, true, url, xCmdEnv );
            data.iniEntry = dp_misc::makeRcTerm(url);