This changes DeviceManagerDx to retain the factory it uses to create the
adapter, and to ensure that the factory is still current in
DeviceManagerDx::GetDXGIAdapterLocked. The factory will be marked not
current when Windows believe the adapter no longer represents the real
state of the machine. One of those cases is when a monitor is connected
or disconnected; there are certainly other cases.
The logic in GetDXGIAdapterLocked is changed to accomodate cases where
we might already have a mDeviceStatus, in which case we attempt to match
the new adapter to what we preserved about the old adapter. As a
fallback, we take the first adapter. This covers the same cases as the
original code, without the asserts about timing and process status.
Differential Revision: https://phabricator.services.mozilla.com/D204570