Issue #22427: TemporaryDirectory no longer attempts to clean up twice when
used in the with statement in generator.