call close on the underlying stream even if flush raises (closes #16597)

Patch by Serhiy Storchaka.
diff --git a/Misc/NEWS b/Misc/NEWS
index 509ea66..40e604a 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@
 Core and Builtins
 -----------------
 
+- Issue #16597: Make BufferedIO.close call close() on the underlying stream if
+  invoking flush() fails.
+
 - Issue #16722: In the bytes() constructor, try to call __bytes__ on the
   argument before __index__.