Fixes mmap error when reading 0-byte files, issue #6321

Fixed by calling the mmap version only if file size > 0