Two small portability fixes (for OpenBSD)

- head -c is not supported on OpenBSD (and perhaps others), so use
  cut(1) instead of a non-standard option.
- mktemp(1) on OpenBSD requires six characters in the template for
  added security.
Merge pull request #538 from jasperla/openbsd-portability

Two small portability fixes (for OpenBSD)