Workhorse failures on stable branches and on recent GitLab tags

Workhorse failures have been discovered on stable branches and tags. Failure example:

https://gitlab.com/gitlab-org/gitlab/-/jobs/7096047344

newLocalFile: remove file "/tmp/TestPackageFilesUpload4276861817/027/gitlab-workhorse-upload3899288812": remove /tmp/TestPackageFilesUpload4276861817/027/gitlab-workhorse-upload3899288812: no such file or directorytime="2024-06-13T19:54:19Z" level=info msg="saved file" client_mode=local_tempfile copied_bytes=9 correlation_id=01J09JMMXKC4FVYJFND0FEXV22 filename=upload is_local=true is_multipart=false is_remote=false local_temp_path=/tmp/TestPackageFilesUpload4276861817/029 remote_id=
time="2024-06-13T19:54:19Z" level=info msg=access content_type="text/plain; charset=utf-8" correlation_id=01J09JMMXKC4FVYJFND0FEXV22 duration_ms=1 host="127.0.0.1:41999" method=PUT proto=HTTP/1.1 referrer= remote_addr="127.0.0.1:33428" remote_ip=127.0.0.1 route="^/api/v4/projects/[^/]+/packages/terraform/modules/" status=200 system=http ttfb_ms=1 uri="/api/v4/projects/group%2Fproject/packages/terraform/modules/mymodule/mysystem/0.0.1/file" user_agent=Go-http-client/1.1 written_bytes=12
newLocalFile: remove file "/tmp/TestPackageFilesUpload4276861817/029/gitlab-workhorse-upload3504986246": remove /tmp/TestPackageFilesUpload4276861817/029/gitlab-workhorse-upload3504986246: no such file or directoryFAIL

Links:

The purpose of this issue is to investigate and to address such failures.