fix issue 12076

Lookaround in ctRegex used the wrong number of total captures thus missing
both a bit of optimization AND a special case of 0 matches.
The latter is the reason of range violation in issue 12076.

Also make ThompsonMatcher use the same scheme as backtracking matcher for lookaround. Take a slice of captures _before_  running engine not at the last point (i.e. successful match), makes code more straightforward as well.