Historically, CURLYN and CURLYM didn't restore lastparen ($+) nor
invalidate higher numbered paren slots (reg->offs[n].end = -1)
when backtracking.
Recent commit
f6033a9d6c91e0c29d5aa5049361a529b5d7cdc4 fixed the lastparen
issue, but then exposed the offs[n].end issue, which had previously been
masked by the too-high lastparen value causing a previous state (such as a
branch) to conveniently wipe out the offending parens on further
backtracking.
Or to put it another way, each backtracker should be expected to clean up
his own mess, not hope that someone previous to him will do it for him.
Fix this by doing the .end = 1 stuff on CURLYN,M failure as well as
BRANCH/TRIE. For consistency, define a new macro to do it.