pthread: check for both pthread_create and pthread_join