python 3: Use queue instead of Queue in py3 env
python 3: Replace thread to _thread in py3 env