crt: use GetEnvironmentVariableW in getopt

The API is available since Windows XP and available in UWP for win8 and win10.

This avoids relying on getenv() from winstorecompat that returns NULL and can't
be reimplemented in a clean way.

Signed-off-by: Martin Storsjö <martin@martin.st>
diff --git a/mingw-w64-crt/misc/getopt.c b/mingw-w64-crt/misc/getopt.c
index ac1fda4..ac7f9fe 100644
--- a/mingw-w64-crt/misc/getopt.c
+++ b/mingw-w64-crt/misc/getopt.c
@@ -345,7 +345,7 @@
 	 *                 optreset != 0 for GNU compatibility.
 	 */
 	if (posixly_correct == -1 || optreset != 0)
-		posixly_correct = (getenv("POSIXLY_CORRECT") != NULL);
+		posixly_correct = (GetEnvironmentVariableW(L"POSIXLY_CORRECT", NULL, 0) != 0);
 	if (*options == '-')
 		flags |= FLAG_ALLARGS;
 	else if (posixly_correct || *options == '+')