FreeBSD build fixes.

Irrlich change also submitted upstream https://sourceforge.net/p/irrlicht/patches/300/.
Since I don't know anything about bsd, I'll leave this to you - if BSD catches more variants (that need the specific code), then certainly go with BSD (and add OpenBSD to the #ifdefs if OpenBSD needs it, too).