FreeBSD build fixes.

Irrlich change also submitted upstream https://sourceforge.net/p/irrlicht/patches/300/.
FreeBSD (and as that code is a bit older, DragonFly) have it. OpenBSD does not. I just checked and NetBSD has it too, so maybe using BSD would work, but it would need a conditional to exclude OpenBSD.