Python Unit Testing Threaded Code