Add a cache to getPublicQualifiedName().

After running the racing demo for one lap, this cache has 252 entries
and a 99.87% hit rate, and has reduced the cumulative JS allocations by
about 15%.
Merge pull request #1587 from nnethercote/cache-get-public-qname

Add a cache to getPublicQualifiedName().