[PATCH v6 09/24] drivers/perf: riscv: Fix counter mask iteration for RV32