py: Improve mpz_and function.

This should now have correct (and optimal) behaviour.