On the number of polynomial solutions of Bernoulli and Abel polynomial differential equations