run-tests: fix some io ordering

backported from default

--HG--
branch : stable
histedit: preserve initial author on fold (issue4296)

When the authorship of the changeset folded in does not match that of
the base changeset, we currently use the configured ui.username
instead. This is especially surprising when the user is not the author
of either of the changesets. In such cases, the resulting authorship
(the user's) is clearly incorrect. Even when the user is folding in a
patch they authored themselves, it's not clear whether they should
take over the authorship. Let's instead keep it simple and always
preserve the base changeset's authorship. This is also how
"git rebase -i" handles folding/squashing.

--HG--
branch : stable
extra : rebase_source : f19259c30e75341b55686e6bfc1ccfbb5249ffb5