fix detection of whether PERF_COUNT_HW_REF_CPU_CYCLES is available
fix prev/next power of 2 warnings