Fix TestStackDumping flaky test and incorrect log output
What does this MR do?
Fixes two tests:
- TestStackDumping
- TestRunCommand_configReloadingRegression
Why was this MR needed?
Example of recent failures:
- TestStackDumping: https://gitlab.com/gitlab-org/gitlab-runner/-/jobs/4605885888#L1570
- TestRunCommand_configReloadingRegression: https://gitlab.com/gitlab-org/gitlab-runner/-/jobs/4610677482#L162
What's the best way to test this MR?
Specific tests should pass when run multiple times with the following args: go test -cpu 2 -race -count 100