Stability and nonlinear dynamics in a Solow model with pollution