Print heaptrack_interpret stats even when it gets terminated
Use atexit to write the stats at the end, which gets called even when main doesn't return (e.g. the app gets terminated).