Improve detection of CPU layout changes. Also don't clear per-core history if CPU layout has been changed.