Use explicit checks for setClaim's/setReference's index parameter

Change-Id: If62023aa2898d99cb3e2d83110da19992c43272d
(cherry picked from commit d79cb99e4287397f36781a71e17cf95c058af632)
Merge "Use explicit checks for setClaim's/setReference's index parameter" into mw1.23-wmf6