Flush and close when dropping stack traces