improved factorization of integer polynomials

Used a bound on the number of factors in ``Z_p[x]`` to speed up some factorizations.

For example

```
>>> minpoly(S('sqrt(1 + 2**(1/5)) + 2**(1/5)*sqrt(1 + 2**(1/5))'), x)
x**10 - 5*x**8 - 20*x**6 - 280*x**4 - 55*x**2 - 27
```

in this PR takes 2.3 seconds on my computer, in master much longer, 10 minutes.

The reason is that in master a polynomial of degree 100 is factored in ``Z_7`` in 26 factors, 
so ``2**26`` cases are considered, while in this PR it is factored in ``Z_13`` in 14 factors, so only
``2**14`` cases are considered.