Fix mmap_bitarray; extend it to Windows

Also add tests.
Fixes breakage introduced in d4d433d756