reduce heap allocations for MemoryMap
auto merge of #9619 : toffaletti/rust/mmap, r=huonw