ENH: Inline check_and_adjust_index

The function takes a considerable amount of time of np.take and
to also fancy indexing. Simple np.takes can speed up by more then
40%, fancy indexes around 10%.
Merge pull request #3947 from seberg/inline-check-index

ENH: Inline check_and_adjust_index