Backport r62724 from trunk.  Fixes issue 2791.  subprocess.Popen.communicate
now closes its stdout and stderr fds as soon as it is finished with them.
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 094ca1b..31c02df 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -660,8 +660,10 @@
                 self.stdin.close()
             elif self.stdout:
                 stdout = self.stdout.read()
+                self.stdout.close()
             elif self.stderr:
                 stderr = self.stderr.read()
+                self.stderr.close()
             self.wait()
             return (stdout, stderr)