riscv: Make stack walk callback consistent with generic code