Fix problems deleting temporary files on Windows; improve forced garbage collection