Fixed erronous check of return value from pthread_barrier_wait.