Riccati equations and polynomial dynamics over function fields