tests: TestMachines.testSerialConsole fix obvious race
tests: TestMachines.testSerialConsole fix obvious race

Fixes #14951

mvollmer/cockpit,garrett/cockpit,cockpit-project/cockpit,garrett/cockpit,martinpitt/cockpit,mvollmer/cockpit,mvollmer/cockpit,martinpitt/cockpit,cockpit-project/cockpit,garrett/cockpit,martinpitt/cockpit,garrett/cockpit,martinpitt/cockpit,cockpit-project/cockpit,cockpit-project/cockpit,mvollmer/cockpit,cockpit-project/cockpit,garrett/cockpit,martinpitt/cockpit,mvollmer/cockpit