fix to make xml2 linking posix compilant
fixed some long standing mem leaks in ModelGen and NOM