fix sparse getindex regression

This PR aims to fix broken `getindex` for sparse matrices with index type other than `Int` and adds some related tests.
ref #7131, #7047

No need to do the `(r1 > r2)` test again?