Fixed #22299 -- Cleanup wizard temp files when possible.

Thanks to @erikr for the review.