tests: kill backgrounded processes more robustly