Fix build of src/common/utility.c on *BSD

The build was already fine on OpenBSD but not on FreeBSD for instance.
The patch extends the "#if defined __OpenBSD__" to DragonFly, FreeBSD
and NetBSD.

Note that this is tested on FreeBSD only.
(cherry picked from commit 02f7e95d2cbe89df25a9ca9c6d23474193cc8d64)