return code checking for pthread_create corrected