Fix random number generation issue with range

In the function _random_mpz, the random number
was taken from a too large range.
Thanks to @andronat for pointing this out.