test_threaded.py: Remove unnecessary imports
test_threaded.py: Improve pep8 and pylint