fix incorrect allocation failure check in pthread_create