Use err_ functions instead of perror(3)

Error messages from perror don't end up in syslog, but instead
they sometimes gets written over the RRD files, corrupting them.
Printf format string fixes
Merge pull request #71 from pabl0/minorbug

Minor bug fixes (perror)