On windows, it happens that the process we called terminates but some other process it creates still has the same output strems and thus the files open, so we can't clean it up. This PR makes the cleanup a best effort.