util/os_file: replace broken windows-detection code with detect_os.h

The meson-windows-vs2019 job was going down the `!defined(WIN32)` path,
leading to a broken build once that path contained non-windows code.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369>
diff --git a/src/util/os_file.c b/src/util/os_file.c
index 5771b27..f02d74a 100644
--- a/src/util/os_file.c
+++ b/src/util/os_file.c
@@ -4,14 +4,14 @@
  */
 
 #include "os_file.h"
+#include "detect_os.h"
 
 #include <errno.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <sys/stat.h>
 
-
-#if defined(WIN32)
+#if DETECT_OS_WINDOWS
 #include <io.h>
 #define open _open
 #define fdopen _fdopen
@@ -31,7 +31,7 @@
 }
 
 
-#if defined(__linux__)
+#if DETECT_OS_LINUX
 
 #include <fcntl.h>
 #include <sys/stat.h>