Handle renaming of "thread" to "_thread" in PY3