Fix mmap error check.
Added logging of allocation error.
...
Merge pull request #788 from dpetzold/mmap-check

Fix mmap error check in 1.4.