Fix setup_cares.py on Python 3, and FreeBSD compilation problems