Fix setup_cares.py on Python 3, and FreeBSD compilation problems (round 2)

Sorry if I messed up typical Github pull request workflow :)