cpufreq-detect.sh: merge in code from /etc/init.d/loadcpufreq