run-tests: send the test result after freeing the channel
Sending the message about the test being "done" signals to the main thread that
a new test can be started. Before this changeset, we sent this signal before
freeing the channel, there is room for a race condition where a new test would
search for a channel before the old test freed the one it used.
This is an example of the failure it would produce:
https://foss.heptapod.net/mercurial/mercurial-devel/-/jobs/552404
# See http://EditorConfig.org for the specification
root = true
[*.py]
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
end_of_line = lf
[*.{c,h}]
indent_size = 8
indent_style = tab
trim_trailing_whitespace = true
end_of_line = lf
[*.t]
indent_size = 2
indent_style = space
trim_trailing_whitespace = false
end_of_line = lf