bpo-38301: In Solaris family, we must be sure to use '-D_REENTRANT' (GH-16446) (#16449)

(cherry picked from commit 52d1b86bde2b772a76919c76991c326384954bf1)

Co-authored-by: Jesús Cea <jcea@jcea.es>
diff --git a/configure b/configure
index 379ac64..2a933cd 100755
--- a/configure
+++ b/configure
@@ -10500,6 +10500,9 @@
     $as_echo "#define _REENTRANT 1" >>confdefs.h
 
     posix_threads=yes
+    if test "$ac_sys_system" = "SunOS"; then
+        CFLAGS="$CFLAGS -D_REENTRANT"
+    fi
 elif test "$ac_cv_kpthread" = "yes"
 then
     CC="$CC -Kpthread"