Bug Fixes in KDE Base
Do not terminate threads when doing dns lookups with timeout
patch based on dfaure and thiago's suggestions:
Thiago and I came up with a design like this:
* a single thread that makes async lookups. It's never blocked, it can always
almost immediately read new requests from a queue and start them.
* each request is encapsulated in a class that has the QString
but also a QSemaphore.
* the main thread can block using a timeout (QSemaphore::tryAcquire(timeout))
* the request class is stored using a shared pointer, so that it's only
deleted when neither the main thread nor the worker thread need it anymore
[otherwise the deletion is a problem, in the timeout case vs the normal case]
(cherry picked from commit a4871052d09eecd928666d482427abebb5f39c56)