Syncing heap before exit