Force the output to be cleaned up when app is closed. (Windows fix)