[tablegen] - Eliminate memory leaks in TGParser.cpp

Ugly solution indicating that a refactoring is necessary to get the ownership under control.