Fix argc check and improve error reporting

Improvements to error reporting:
- print errors to stderr
- return non-zero exit status on failure
- use perror to print a useful failure reason for mmap