Updated mpz/jacobi.c from GMP 5.1.3.