[3.14] gh-154307: Fix TemporaryDirectory cleanup on DragonFly BSD (GH-154309) (GH-154312)
On DragonFly BSD, removing a file or directory with the UF_NOUNLINK flag
fails with EISDIR (IsADirectoryError) instead of EPERM, so the cleanup did
not reset the flags. Handle IsADirectoryError the same as PermissionError.
(cherry picked from commit
1c1088b1da5a7484b7b04e90ccc47aa362e709eb)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>