Fix thread import in test_misc