aexpect: Add cmd_output_safe method to ShellSession objects

In network tests, it is frequent that we want to execute
commands in a serial console prompt. In such a setup,
aexpect is frequently confused with kernel debug messages
being printed while the command was being executed. This
is obviously not nice and by now we have a crescent number
of attempts to implement a simple algorithm: If the
read_up_to_prompt times out, let's send a carriage return
to the serial session and try again to match a prompt,
similar to what humans would do.

So implement a cmd_output_safe to aexpect, trying to match
the interface of the API cmd_output, that will try to
handle the unpredictable console in a very naive, but
functional way. Also, replace the common implementations
with this new method.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
qemu: network tests - Use .cmd_output_safe

Rather than the many custom implementations that grew
over the years.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>