Refactor the creation of the job temporary file path

Summary

This issue is extracted from gitlab#29407 (closed)

From the comments gitlab#29407 (comment 947110258) and gitlab#29407 (comment 989127953)

Step Status
1. GitLab: Stop expanding file variables when sending to Runner gitlab#365859 (closed)
2. Runner: Refactor the creation of the job temporary file path 👈 You are here
3. Fix file variables in Runner gitlab#29407 (closed)

Technical proposal

from: gitlab#29407 (comment 935276800)

Extract creation of the job temporary file path from the ShellWriter interface.

The path depends on the job data. Until it needs to be printed, there is nothing shell-dependent that needs to be considered.

I think that we should have the code that creates that path moved to the common.Build structure, and the ShellWriter implementations should focus on how to present the path and how to prepare the environment during the script execution for file creation there (like calling a shell/os dependent command to create a directory where temporary files are stored).

Edited by Mark Nuzzo