Fix an infinite loop in new transformation code.

Zero-length regex matches in the new transformation code
would fail to move the search range forward, so that the
same point would be matched repeatedly. This resulted in
an infinite loop both in the count-only version and the
replacing version of the :substitute command.