Superposition rules and second-order Riccati equations