Portability changes:
- macOS nor Linux have MAP_NOCORE nor MAP_NOSYNC. Define as 0.
- macOS doesn't have SEEK_DATA nor SEEK_HOLE. Define as -1 so that lseek will return -1 (with errno set to EINVAL).
- gcc correctly warns that error is assigned but not used in image_copyout_region(). Fix by returning on the first error.