tests: Fix rare deadlock in profile threads tests

There is a rare deadlock in yappi profiler, when starting a profile in
the same time a thread is started. This caused the
ThreadsProfileTests.test_running_threads to fail once in a while.

The deadlock happens when yappi find a new thread it does not know yet,
and try to get the thread class name. If the first call happen to be the
_active_limbo_lock.acquire, yappi calls back into python
threading.currentThread, which returns a _DummyThread, which try to lock
again _active_limbo_lock to register itself and deadlocks. See [1] for
complete details about this.

Since we start yappi profiles first thing on startup, this bug should
not effect vdsm in production.

Now the tests wait until the thread is fully started before running the
profiled function, avoiding the possible deadlock.  I verified this
change by running the failing tests 1000 times in a loop, without any
failure. Before this, we could not get 100 successful runs.

[1] https://code.google.com/p/yappi/issues/detail?id=48

Change-Id: I03594842ca341a7a2d54542396ef8ce82a67e167
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
Reviewed-on: http://gerrit.ovirt.org/31470
Reviewed-by: Francesco Romani <fromani@redhat.com>
Reviewed-by: Dan Kenigsberg <danken@redhat.com>