Fix define check for FreeBSD

Also add other BSD defines that are likely.