[libc] Implement mkdtemp (#222106)

Add the POSIX mkdtemp entrypoint for Linux targets (aarch64, riscv,
x86_64).

Extract the shared template replacement and random character retry loop
into linux/mktemp_util.h, relocating mkstemp to linux/mkstemp.cpp and
reusing the helper across both entrypoints.

Add comprehensive unit tests covering directory creation, permissions,
uniqueness, and invalid template handling.

Assisted-by: Automated tooling, human reviewed.
GitOrigin-RevId: a173863e63415ae54b5d0abf1bc5897c61604e5f
14 files changed