check indices in sparsevec(::Dict). fixes #8363
Merge pull request #8373 from tanmaykm/fix8363

check indices in sparsevec(::Dict). fixes #8363