Runner leaks process handles on Windows under the Windows Job feature flag

Summary

When using the Windows Job feature flag FF_USE_WINDOWS_JOB_OBJECT, spawning any process results in leaking the process handle

Steps to reproduce

Use the FF_USE_WINDOWS_JOB_OBJECT feature flag with the shell executor, then run any job. You should see leaked handles in Sysinternals/Process Explorer

Actual behavior

Leaked process handles

Expected behavior

No leaked process handles

Relevant logs and/or screenshots

ProcExp-LeakingHandles

Environment description

Reproduced using a local GitLab runner on Windows.

Used GitLab Runner version

Built from source on 5/March/2026

Possible fixes

See !6498 (merged) for the fix