Fix define check for FreeBSD

Also add other BSD defines that are likely.
Merge pull request #3 from dajobe/master

Fix define check for FreeBSD