Reworked test to account for pthread_create failures.