add missing memory barrier to pthread_join