Check that the value passed to glActiveTexture doesn't bypass the limits