More build fixes for FreeBSD

With this fixes it is possible to compile tvheadend without any external patches on FreeBSD 8.4, 9.2 and 10.0 on amd64 and i386.