Fix for OS X

OS X does not support mremap. Hopefully using ftruncate is equivalent.