fix missing dirfd references for FreeBSD