In win32, use mmap when writing as well

This is another solution to #2338 (see also #2339).