OpenBSD compabilities

Fix various OpenBSD compabilities found by Patrik Lundin <patrik.lundin.swe () gmail.com>