The first commit will make the tests fail and print a warning when the tmpdir exists.
The second commit will make the tests skip over any existing zombie daemons with high probability.
Both commit should improve the bad user experience reported in #9086. If the second commit is too controversial, I am happy to drop.