Check for OpenBSD and NetBSD platforms

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Fix warnings on NetBSD

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>