selftests/functional: basic_tests: Remove unused import

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.utils.process: Refactor and bugfix

Chasing a bug, I found opportunities to improve the
process related code:

*  Populating the CmdResult object on every
   opportunity that wait() or poll() is executed
   in the subprocess.

*  Changing the name of the original wait() method
   to run(), making it consistent with the run()
   function of the module.

Also, to avoid a defunct process on a Ctrl+C, register
the SIGINT signal handler to the SubProcess wait()
method.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
avocado.job: More Ctrl+C handling fixes

1) Revert the test subprocess side SIGINT handler
   to its original form (just raising an appropriate
   TestInterruptError exception)
2) Introduce another break condition to the infinite
   loop that collects test state, in the end, it was
   the big problem that prevented the test to terminate
   correctly on Ctrl+C
3) Start counting the ignore window time after Ctrl+C is
   pressed by the second time, not the first.
4) Fix the KeyboardInterrupt code, it is supposed to
   return an exit code, not call sys.exit().

With this, we finally get trinity to call its Ctrl+C
handler correctly and cleanup after itself, as well
as avocado cleaning up correctly if enough time is
given to the test subprocesses to end.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
tests/trinity: Don't print ResultCmd object

Not necessary or desirable, since we get trinity's
output in the logs already, and the output of the
test is quite extensive.

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