Add a variant of fs::resize_file for use immediately before opening a
file with mapped_file_region::readwrite. On Windows, _chsize
(ftruncate) is slow, but CreateFileMapping (mmap) automatically
extends the file so the call to fs::resize_file can be skipped.
This optimization was added to FileOutputBuffer in
da9bc2e56d5a5c6332a9def1a0065eb399182b93; this commit just extracts the
logic out and adds a unit test.