leak-detective: Try to properly free allocations after deinitialization