fix issue 8203, similar issue with lookaround

When using a temporary engine as closure its generation counter
should be tracked separately for each lookaround.

For now just use built-in AA, later we could find better places
to store this counter in.
Merge pull request #1841 from blackwhale/issue-8203

fix issue 8203, similar issue with lookaround