Use refcounting to lower the number of registrations
The fix for MDSAL-461 has introduced multiple registrations for
each YangModuleInfo, which while correct ends up parsing the same
sources multiple times.
This patch updates the handling to guard against that possibility
by adding an explicit reference counting layer, so that each
instance of YangModuleInfo is registered exactly once.
Change-Id: Id925391241cd36a26bfa05cd28f8b747d5d7ba24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
066ee3a904b39637ed7861d3aee2d55d67987139)