vcl: fix crashes when retrieving objects for MSAA

The ImplHandleGetObject() function modifies the Application Settings and
must take the SolarMutex for this; otherwise we get crashes when another
thread calls StyleSettings::GetPersonaHeader() during some unoapi test.

Also fix another HWND to long cast; use LRESULT which is Win32 for intptr_t.

Change-Id: I5580f88ed0a8e9955697655ace94584e2307982d
(cherry picked from commit db214684057e3ff2fa32d57c00507309dd6c24d6)
winaccessibility: replace CoCreateInstance with direct instantiation

This is an alternative (to 732ec36edfd09d2091d70c4d71b5f182fe279c45)
solution to the "CoCreateInstance does not work" problem:
replace all CoCreateInstance calls with equivalent calls to create
the components directly.

Since the only reason why this COM stuff needs to be registered
at all is that AccObject uses CoCreateInstance() to create its
COM objects, another possible solution appears to be to simply link
the libraries and instantiate the COM objects directly, without COM.

The only difference appears to be that CoCreateInstance would
automatically add proxy objects in case the COM objects reside in a
single-threaded appartment; not sure if that is relevant here.

Reviewed-on: https://gerrit.libreoffice.org/6792
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
(cherry picked from commit 3b86569fcba210eb6570fabef7ff8abf6aff91f0)

Conflicts:
	winaccessibility/source/UAccCOM/AccHypertext.cxx
	winaccessibility/source/UAccCOM/AccTable.cxx
	winaccessibility/source/UAccCOM/EnumVariant.cxx
	winaccessibility/source/UAccCOM/MAccessible.cxx
	winaccessibility/source/service/AccObject.cxx

Change-Id: I8ffb8af501f6084f3145fa4d4f53366a070e1691
winaccessibility: fix my stupid mistake in createAggInstance

Change-Id: I7701021befcf1dbad85557c2095fe4bf0b4e0ff1
(cherry picked from commit d0e8e6e3cd51736583603e37f0ba2ff7bdf29f5c)
Revert "winaccessibility: let CoCreateInstance calls find the components"

This only works partially: the ClassObjects are only registered on the
main thread; CoCreateInstance on other threads still fails.

This reverts commit 29c6216af8c502f220bb84857d3dda901ddfd234.

(cherry picked from commit b54d441ad728ffce8e543de10bd897f0900422b5)
winaccessibility: remove global g_acc_manager

It is possible to retrieve it via the AccTopWindowListener.

Change-Id: I6cc5ab25bc937d0d9f4de54a1bed09a76ce27491
(cherry picked from commit fabca7370e22f96ae041dc179475b35c87ac53ec)
vcl: check if AT is running before loading the library

... which should result in faster startup if it's disabled.

Change-Id: I39774b0a56f186d08270c2f17b2b20a823f21dc2
(cherry picked from commit b44ed4c408d92f7a1a3f2390c056d518c137ddd0)