Delete QNAM instance when it is not needed anymore.

The QNAM is still shared in the thread but it may happen that is has to
be recreated. The main advantage of this change is that we clean
memory and that the QNAM is not destroyed after ~QCoreApplication.

Change-Id: I3dc6a5e7d85b2feebb498700986d27d203dbb89e
Reviewed-by: Andras Becsi <andras.becsi@digia.com>