Use threading instead of createfilehandler().

Python on Windows doesn't have createfilehandler().