Fix call to pthread_join