C++: Fix crash in LookupContext::lookupType()

Task-number: QTCREATORBUG-10019
Change-Id: I7970c2f1ea3044e11250b8dbaf9b29ba3e7f34ef
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>