Fix deadlocks in debugger infrastructure on Mac

Set QReadWriteLocker to recursive. This is needed e.g. to allow
_q_changeServiceState to get a read lock when called from inside
receiveMessage.

Change-Id: I287a7c7f44e94005c0458825f8f6d1877ee914dd
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Fix segfault in autotest

Do not re-declare variable in local scope!

Change-Id: I4f66081603ce86d78965ac12368bda66d86ff0c4
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Improve output of test case

Change-Id: Ib36583120ca42835534f0f8494637aeb9618f317
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Fix infinite loop in QQmlIncubator::forceCompletion

Without this change I'm getting this backtrace
3  0x4025b9f2 in QQmlIncubatorPrivate::incubate (this=0x18daa78, i=...) at qml/qqmlincubator.cpp:273
4  0x4025c1c2 in QQmlIncubator::forceCompletion (this=0x1527360) at qml/qqmlincubator.cpp:592
5  0x404e1626 in QQuickVisualDataModelPrivate::object (this=this@entry=0x13909f8, group=QQuickListCompositor::Default, index=index@entry=1, asynchronous=asynchronous@entry=false) at items/qquickvisualdatamodel.cpp:900
6  0x404e1f7e in QQuickVisualDataModel::item (this=<optimized out>, index=1, asynchronous=<optimized out>) at items/qquickvisualdatamodel.cpp:968
Note: This is with patched 5.0.x, change QQuickVisualDataModel to QQmlDelegateModel for >= 5.1
      and line numbers may be a bit off

What is happening:
QQmlIncubator::forceCompletion is doing
    while (Loading == status()) {
        while (Loading == status() && !d->waitingFor.isEmpty())
            static_cast<QQmlIncubatorPrivate *>(d->waitingFor.first())->incubate(i);
        if (Loading == status())
            d->incubate(i);
    }
Calling QQmlIncubatorPrivate::incubate on the first item of d->waitingFor

Then, that item is getting to QQmlIncubatorPrivate::incubate and happens that
progress is QQmlIncubatorPrivate::Completed and waitingFor is not empty,
so the only thing that QQmlIncubatorPrivate::incubate ends up doing is
calling a few calls over vmeGuard and returning, that way the inner
waitingFor items never finishe incubating and you end up in an inifite loop inside
        while (Loading == status() && !d->waitingFor.isEmpty())
            static_cast<QQmlIncubatorPrivate *>(d->waitingFor.first())->incubate(i);

This patch basically replaces this loop with a loop that does
        while (QQmlIncubator::Loading == status && !waitingFor.isEmpty())
            static_cast<QQmlIncubatorPrivate *>(waitingFor.first())->forceCompletion(i);

This way we make sure we incubate the waitingFor items of our waitingFor items

Change-Id: I4298efc7ba9d8af624bb138e64b92a40ed4c4dc9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>