[XLA:GPU] Fix infinite loop in `ApproximateMatch` indexing test util.
[XLA:GPU] Fix infinite loop in `ApproximateMatch` indexing test util.

Previously, if one string was strictly a prefix of the other one (ignoring
spaces), we would run into an infinite loop when reaching the end of the
shorter string.
