intel: fix for a semantic change in libdrm 2.4.57 and later

When a client does

  xglInitAndEnumerateGpus();
  xglCreateDevice();
  // do something

  // reinitialize without xglDestroyDevice() first!
  xglInitAndEnumerateGpus();
  xglCreateDevice();
  // do something else

the driver will

  open()
  close()
  open()
  close()

on the DRM device.  The problem is that the two open()s may return the same
value and confuse libdrm since 2.4.57 (specifically, commit 743af59669).
Making intel_winsys intel_gpu-owned allows the driver to do this instead

  open()
  intel_winsys_create_for_fd()
  intel_winsys_destroy()
  close()
  open()
  intel_winsys_create_for_fd()
  intel_winsys_destroy()
  close()
diff --git a/icd/intel/gpu.c b/icd/intel/gpu.c
index 3e3e44e..5303516 100644
--- a/icd/intel/gpu.c
+++ b/icd/intel/gpu.c
@@ -32,6 +32,7 @@
 #include <unistd.h>
 
 #include "genhw/genhw.h"
+#include "kmd/winsys.h"
 #include "dispatch.h"
 #include "queue.h"
 #include "gpu.h"
@@ -172,8 +173,6 @@
     gpu->primary_fd_internal = -1;
     gpu->render_fd_internal = -1;
 
-    gpu->device_fd = -1;
-
     return gpu;
 }
 
@@ -366,18 +365,36 @@
 
 XGL_RESULT intel_gpu_open(struct intel_gpu *gpu)
 {
-    gpu->device_fd = gpu_open_primary_node(gpu);
-    if (gpu->device_fd < 0)
-        gpu->device_fd = gpu_open_render_node(gpu);
+    int fd;
 
-    return (gpu->device_fd >= 0) ? XGL_SUCCESS : XGL_ERROR_UNKNOWN;
+    assert(!gpu->winsys);
+
+    fd = gpu_open_primary_node(gpu);
+    if (fd < 0)
+        fd = gpu_open_render_node(gpu);
+    if (fd < 0)
+        return XGL_ERROR_UNKNOWN;
+
+    gpu->winsys = intel_winsys_create_for_fd(fd);
+    if (!gpu->winsys) {
+        icd_log(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, XGL_NULL_HANDLE,
+                0, 0, "failed to create GPU winsys");
+        intel_gpu_close(gpu);
+        return XGL_ERROR_UNKNOWN;
+    }
+
+    return XGL_SUCCESS;
 }
 
 void intel_gpu_close(struct intel_gpu *gpu)
 {
+    if (gpu->winsys) {
+        intel_winsys_destroy(gpu->winsys);
+        gpu->winsys = NULL;
+    }
+
     gpu_close_primary_node(gpu);
     gpu_close_render_node(gpu);
-    gpu->device_fd = -1;
 }
 
 enum intel_ext_type intel_gpu_lookup_extension(const struct intel_gpu *gpu,