Portability fixes for OpenBSD (and possibly NetBSD and others).