Fix invalid directory path for Windows.

Fix invalid directory path (from `/tmp` to `%TMP%`) on Windows.

This fixes #12715