src: release heap snapshot, fix memory leak

Release the heap snapshot after it's written to disk.  Fixes unbound
memory consumption when repeatedly taking snapshots.

Fixes #45.