Fix rules for parsing numeric escapes in regexes

Commit 726ee55d introduced better handling of things like \87 in a
regex, but as an unfortunate side effect broke latex2html.

The rules for handling backslashes in regexen are a bit arcane.

Anything starting with \0 is octal.

The sequences \1 through \9 are always backrefs.

Any other sequence is interpreted as a decimal, and if there
are that many capture buffers defined in the pattern at that point
then the sequence is a backreference. If however it is larger
than the number of backreferences the sequence is reparsed as
an octal digit. A consequence of this is that \118 might be treated
as a backreference to the 118th capture buffer, or it would be treated
as the string "\11" . "8", which is quite different.

Nevertheless this left an awkward edge case, of multi digit sequences
starting with 8 or 9 like m/\87/ which would result in us parsing
as though we had seen /\x{00}87/ (iow a null byte at the start),
which is clearly wrong. Interpreting this as octal makes no sense,
and the precedent for "\9" is "Unrecognized escape \9" which doesn't
make sense either, as we could recognize the escape as a capture buffer.

This patches fixes the cases where the capture buffers are defined,
and causes things like the \87 or \97 to throw the same error that
/\8/ would. One might argue we should complain about an illegal
octal sequence or something like that, but this seems more
consistent with an error like /\9/ and IMO will be less surprising
in an error message.