close file handle after mmap. fixes #3884