tests: Separate test runner from test library

The test runner was used both as a script and as a library for testing
utitilies. This cause the module to be imported twice, performing
various hacks twice.

Runnning pthreading.monkey_patch() twice fails with upstream pthreading,
which ensure that monkey pataching is not too late. The check in
pthreading should be fixed, but it expose the problem in the testrunner.

This separate the library code from the script realted code and hacks
that must run once in the context of the test runner script, fixing
the double invocation of pthreading.monkey_patch().

Change-Id: I9aa145f929e27699982a15a662269f2a7b3cdfc3
Bug-Url: https://bugzilla.redhat.com/1119172
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/30022
Reviewed-by: Yaniv Bronhaim <ybronhei@redhat.com>
Reviewed-by: Yoav Kleinberger <ykleinbe@redhat.com>
Reviewed-by: Francesco Romani <fromani@redhat.com>
Reviewed-by: Martin Sivák <msivak@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>