utils: Add fstream wrapper to allow to pass unicode filename on Windows
Summary:
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 PR13878 and PR15468 (related bug fix).
Depends on D5539.
Test Plan:
ninja check make check
Run the Gitian builds.
Build and run for Windows. Run test_bitcoin on Windows.
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D5539