Avoid using `mktemp -p` (#60091)
It is not supported in macOS 13 userland which causes CI failures. For
background info [see
here](https://github.com/JuliaLang/julia/pull/59980#issuecomment-3487473135).
This is a subset of PR #60080 but unlike that, it only solves the
specific issue causing trouble in CI right now, and does not attempt to
resolve a bunch of other things -- which may very well all be fine and
nice and desirable, but it's quite a bit more to review.