Minor: Add 'const' to is_valid()
Fix compile warning on FreeBSD/MacOSX

mlock() / munlock() need the <sys/mman.h> header on FreeBSD/MacOSX
Split platform-functions into their own files

The wrappers for read(), write() etc. are implemented in
platform_unix.cc and platform_msvc.cc. This keeps main.c
clean.
clear unwanted but sensitive bytes

the user wants only n bytes of the generated buffer. before printing
these bytes we clear the rest.
improve documentation