Implemented mutex to guard num_primes variable. But am getting 1874 for the number of primes from 1 to 10,000 when I should be getting 1229.