tests: extend run_service mockup for pre-recorded output
tests: extend run_service mockup for pre-recorded output

And also handle input written if just stdin.flush() is called but not
stdin.close().

marmarek/qubes-core-mgmt-client,marmarek/qubes-core-mgmt-client,marmarek/qubes-core-mgmt-client