IndexAtValue handles all masked array case.