[3.10] gh-91700: Validate the group number in conditional expression in RE (GH-91702) (GH-91831)

In expression (?(group)...) an appropriate re.error is now
raised if the group number refers to not defined group.

Previously it raised RuntimeError: invalid SRE code.
(cherry picked from commit 48ec61a89a959071206549819448405c2cea61b0)
3 files changed