```
If compiled with mingw, use glibc++ extension stdio_filebuf to open the
file by FILE* instead of filename.
In other condition, we can use boost::fstream.
```
Backport of core [[https://github.com/bitcoin/bitcoin/pull/13878 | PR13878]] and [[https://github.com/bitcoin/bitcoin/pull/15468 | PR15468]] (related bug fix).
Depends on D5539.