Correctly set the FF position after a match.

When the fast-forwarding can yield an FF position pointing just before the end
of the match, we need to make sure not to stay in an infinite loop.