virt.kvm_vm: Introduce background error queue

Introduce a background error queue to store exceptions
happened during virt background tasks (such as aexpect
instances and screendump thread). With this queue,
it is possible to store exception information useful
to fail tests at certain points. Examples:

* We can detect qemu suffered a crash from inside the
  aexpect thread
* We can detect screen inactivity on the screendump
  thread and fail the unattended install test without
  having to wait the entire timeout of the test

The next patches will introduce that functionality.

Implementation consists in a virt test attribute,
background_error test, that is a Queue.Queue()
(thread safe), background threads that want to
make use of it need to catch the exception they
want to propagate and store it in the queue
using put(sys.exc_info).

Then in every convenient situation to do so, subtests
can call the test.verify_bg_errors() method
(in the beginning or end of each test loop, where
operations such as migrations are executed).

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt.virt_env_process: fail tests due to guest screen inactivity

In a very specific test (unattended_install), all OEM installer
mechanism will present intense guest screen activity, so screen
inactivity for a relatively long time almost always mean something
went very wrong and the installer is stuck.

So create a mechanism to detect screen inactivity for any vm that
takes place in the test - have a timer for each vm that is reset
only if the next screenshot is different than the previous. So,
if the vm got stuck somewhere at the install process, for example:

* Wrong Windows CD Key
* Guest OS does not see a disk controller due to lack of drivers
* BIOS got stuck

And other similar cases, we'll have a test failure before the full
test timeout (that for Windows may be up to 3 hours). So we save
time and know about such situations earlier.

The patch introduces the parameters on base.cfg, subtests.cfg, and
also introduces a sensible default for inactivity treshold (30 min).

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt tests: Introduce inactivity watcher for unattended_install

With this patch, if the screen got inactive during unattended
install for more than 30 minutes, an error will be thrown. For
any other tests, we'll just log a debug message, since in other
tests we do not expect to see much action going on the screen.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
virt.kvm_vm: Introduce vm.verify_userspace_crash()

In order to capture any qemu crashes, introduce a method
that scans qemu output and throws an error if a core dump
condition is found.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
KVM test: Verify qemu process before throwing monitor exceptions

When qemu suffers a segmentation fault, monitor code might still
want to issue commands to a VM, masking the segmentation fault.

So, pass the vm object to the monitor code, and before throwing
monitor exceptions, verify the state of the qemu process (whether
it crashed or not), and throw the QemuSegFaultError if the process
crashed:

22:08:44 DEBUG| QemuSegFaultError: Qemu crashed: /bin/sh: line 1:  6847
Aborted                 (core dumped)

This will make analyzing such failures much easier.

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