Fixed nosetest error with threads