BUG: sparse: downcast 64-bit indices safely to intp when required

Downcast 64-bit indices to 32-bit intp when required, but check
whether this is a safe operation, to be sure.

ufunc.reduceat and np.bincount deal only with intp data type.
Merge pull request #3389 from pv/sparse-downcast

BUG: sparse: downcast 64-bit indices safely to intp when required