regcomp.c: Change error reporting mechanism slightly
There are (rare) constructs which cause regcomp.c to modify the user
input stream (stashing the original), and that is parsed instead before
returning to the continue with the original. A problem arises if an
error occurs during the parsing of this modified version. We want to
report the location of the error and context based on the original.
This led to
285b5ca0145796a915dec03e87e0176fd4681041 (fixing #126261).
This new commit simplifies the mechanism so that it is easier to
understand.