Fix build on FreeBSD

Add compatibility fixes to enable build on FreeBSD and get executable path via sysctl(3) instead of reading from very rarely used /proc.

Another problem we have (not in this pull request) is that the creation of sqlite repo's with "." in the schema name fails. We have to modify repo.cpp and generate_buildinfo.sh or set HHVM_REPO_SCHEMA manually.

The FreeBSD port is working again, you can inspect its structure at:
http://svnweb.freebsd.org/ports/head/lang/hiphop-php/

Applied patches are under files/