Add a refcount mechanism for substatements
We need to defer cleaning substatements until there is no way
they could be referenced again. This can happen, for example,
when we make a copy through uses: source grouping can be built
independently, but needs to retain its effective statements
until all its copies are built as well.
This expands InferredStatementContext 8 bytes, which we will need
to reclaim/justify somehow.
At this point we end up with negligble post-build residue, but
peak usage remains high (and goes up a bit). We'll build on top
of that in further patches.
JIRA: YANGTOOLS-1184
Change-Id: I5d26846ee1a5ce705671d9e66d45137a3d1084cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>