Fix mmap and other minor issues on w32