FreeBSD build fixes.

Irrlich change also submitted upstream https://sourceforge.net/p/irrlicht/patches/300/.
I'd leave it with FreeBSD for now, if someone ports it to another BSD changing it and it is needed changing it should be trivial.