close some memory leaks involving nailgun
fix visibility and name of SORT_CACHE_TABLE
Merge pull request #1200 from dwightguth/memoryleak

close some memory leaks involving nailgun