fix check of return value from mmap