Tidy up the control flow in mmap allocation