At least FreeBSD is picky in that it requires PROT_READ if we're going
to read a mmap()ed memory region mapped, only specifying PROT_WRITE
doesn't imply PROT_READ. Other OSen seem to handle this differently.
Also add a missing pointer reinitialisation to the buf pointer.
Reported-by: Sean Eric Fagan
Signed-off-by: Ralph Boehme <firstname.lastname@example.org>