QmlProfiler: fix potential crash

fixes Ib2ea66bd5694046577a0b5a0e2f611f3ffba0238

Change-Id: Ib7a4e02391513984f1c81a43a5fab490b7f88923
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>