bug in mmap() and mremap() return value - and a fix