fix hanging issue when closing files on windows (completing a download)