shell: fix TemporaryDirectory error with the with statement when ZSH
From https://docs.python.org/3/library/tempfile.html#tempfile.TemporaryDirectory.name:
The directory name can be retrieved from the name attribute of the returned object. When the returned object is used as a context manager, the name will be assigned to the target of the as clause in the with statement, if there is one.
Bug added in 5a8b7625