Don't hang the worker script engine
1. Wake up the syncDone wait condition when delete the QDeclarativeListModelWorkerAgent,
otherwise the the whole worker script engine thread will hang at the sync() call
and can't exit gracefully.
2. Call QCoreApplication::processEvents() before delete the worker script engine to
cleanup all pending events in main thread to release wait conditions which
some worker scripts/agents are waiting for (QDeclarativeListModelWorkerAgent::sync() for example)
Change-Id: Ia3712318771633e68238b4d629ba870ff7ce45b9
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>