Dynamically adjust cpufreq_max_limit according to scaling_max setting without breaking power save mode

(credit to yank555-lu, simone201)