Replace pthread_join() with bool completion variables