main/cpufrequtils: apply upstream commits to fix arm build

and also the other issues we were already patching for.