Fix test_thread_util for Python 2.4