error reporting for pthread_create