Add missing headers to fix build on FreeBSD 8.4