Set the buffer of an fstream to empty when the underlying file is closed. This 'fixes' PR#38052 - std::fstream still good after closing and updating content.

llvm-svn: 350603
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 8f9346922c2e9a8dff14cbaeb2b2eb7646b49ba3
diff --git a/include/fstream b/include/fstream
index 332b474..711e484 100644
--- a/include/fstream
+++ b/include/fstream
@@ -702,6 +702,7 @@
             __file_ = 0;
         else
             __rt = 0;
+        setbuf(0, 0);
     }
     return __rt;
 }