gdkglcontext-win32.c: Fix running with Mesa drivers

Some GL drivers such as Mesa-D3D12 do not allow one to call SetPixelFormat() on
a given HDC if one pixel format has been already set for it, so first check the
HDC with GetPixelFormat() to see whether a pixel format has already been set
with the HDC, and only attempt to acquire the pixel format if one has not been
set.

This will fix running with GL on Windows using the Mesa drivers.
13 jobs for mesa.win32-4.0 in 41 minutes and 57 seconds (queued for 1 second)
latest
Status Job ID Name Coverage
  .Pre
failed #1273248
allowed to fail
style-check-diff

00:12:47

 
  Build
passed #1273249
fedora-x86_64

00:19:09

passed #1273251
installed-tests

00:18:44

passed #1273253
macos
macos

00:11:57

passed #1273477
win32-ps
msys2-mingw64

00:08:33

passed #1273250
release-build

00:22:08

failed #1273252
win32-ps
msys2-mingw64

00:00:19

 
  Analysis
failed #1273255
asan allowed to fail
asan-build

00:17:11

passed #1273254
static-scan

00:28:52

 
  Docs
passed #1273256
reference

00:22:51

 
  Flatpak
manual #1273257
flatpak allowed to fail manual
flatpak-manual:demo
manual #1273259
flatpak allowed to fail manual
flatpak-manual:icon-browser
manual #1273258
flatpak allowed to fail manual
flatpak-manual:widget-factory
 
Name Stage Failure
failed
style-check-diff .Pre
   g_assert_cmpint (sum, ==, 0);

- gdk_array(clear) (&v);
+ gdk_array (clear) (&v);
}

#undef _T_
Cleaning up file based variables
ERROR: Job failed: exit code 1
failed
asan-build Analysis
 - css: 202 total, 202 pass, 0 fail
Processing gtk suite a11y:
- a11y: 22 total, 22 pass, 0 fail
Processing gtk suite tools:
- tools: 4 total, 3 pass, 1 fail
Processing gtk suite reftest:
- reftest: 134 total, 132 pass, 2 fail
Cleaning up file based variables
ERROR: Job failed: exit code 1