Openbsd portability

Stuff has changed since 0.19, so here are some fixes to make things build on OpenBSD again.