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.