Patch from Lorenzo to avoid memory corruption in bignum sqrt.