clean up and fix logic for making mmap fail on invalid/unsupported offsets