bpo-31804: Fix multiprocessing.Process with broken standard streams (GH-6079) (GH-6080)

In some conditions the standard streams will be None or closed in the child process (for example if using "pythonw" instead of "python" on Windows).  Avoid failing with a non-0 exit code in those conditions.

Report and initial patch by poxthegreat.
(cherry picked from commit e756f66c83786ee82f5f7d45931ae50a6931dd7f)

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
diff --git a/Lib/multiprocessing/process.py b/Lib/multiprocessing/process.py
index 8fff3e1..cd592d0 100644
--- a/Lib/multiprocessing/process.py
+++ b/Lib/multiprocessing/process.py
@@ -314,8 +314,7 @@
         finally:
             threading._shutdown()
             util.info('process exiting with exitcode %d' % exitcode)
-            sys.stdout.flush()
-            sys.stderr.flush()
+            util._flush_std_streams()
 
         return exitcode