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

Same here. `r1` is reassigned with the result of `searchsortedfirst`.