Guarantee QTextEngine::findItem() returns -1 for invalid strPos

...and check the returned value where it may cause undefined behavior
(i.e. negative amount of items or iteration from -1 to n).

Change-Id: Ib7bd9ab178526df45b792ad48b91ebbab6be861a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>