Fix #10252 again (hopefully definitely).  Patch by Brian Curtin.
diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py
index 5676e91..95fa3ed 100644
--- a/Lib/distutils/cygwinccompiler.py
+++ b/Lib/distutils/cygwinccompiler.py
@@ -377,9 +377,7 @@
     try:
         out_string = out.read()
     finally:
-        out.stdin.close()
-        out.stdout.close()
-        out.stderr.close()
+        out.close()
     result = RE_VERSION.search(out_string)
     if result is None:
         return None