While running into failures on unmap calls, it becomes difficult to
figure out what's wrong. Break the dieOnMapUnmapError into specific
versions for map, unmap, and then one for mprotect.
Also, put these in a common linux space so that all linux derived code
can reuse this code.
Most of the implementations are copied from linux.cpp and we will be
keeping those memory functions in linux.cpp for a while until we are
able to switch to use MemMap completely.
The remaining part is SizeClassAllocator32 which hasn't been switched to
use MemMap interface
Reviewed By: cferris
Differential Revision: https://reviews.llvm.org/D146453