Force heap scope when named captures are present.

Named captures currently require that there be a heap scope
available, since that's how the match logic updates the local
variables that go with the capture names. Because backref no
longer requires a scope on its own, the method did not properly
use heap-based local variables in the presence of a named capture,
and as a result did not see the updated values.

My fix adds logic to ASTInspector that forces a heap scope when
there is a Match2CaptureNode present, indicating named captures.

Note: There's nothing about named captures that *must* have a
heap scope. We could update them in the calling code after the
call returns, one by one. This would be slower than updating them
as a group, as in the current logic, but it would not force us to
allocate the extra scope and force all local variables to the
heap.