Decrease memory footprint of heap snapshot. (#6297)
Contributes to https://github.com/flutter/devtools/issues/6144
This PR decreases memory footprint for snapshot for Counter application by 18%, by reusing the class HeapClassName. The gain is bigger for applications with bigger number of objects per class.