[TSan][libdispatch] Replace NSTemporaryDirectory in tests
After this change, most tests don't have a dependency on Foundation.
Note: To hold the file name tempnam allocates a new buffer. We leak
this buffer (omit the free), but I don't think we need to care.
Reviewed By: kubamracek
Differential Revision: https://reviews.llvm.org/D60591