Factor out mmap into Misc.c b_map_file_by_path

Factoring out the function makes the calling code shorter
and makes the code reusable.  When we port to Windows (or
possibly to OS X using mach_vm) it will be easier to change
the implementation.