cpufreq: Fix optimal_freq logic on ramp down