Don't use Standard Library routines in qthread_p.h

Just write the for loops by hand so we don't need to use the Standard
Library. That's necessary to support a -no-stl build.

This patch is not necessary in Qt 5 since Qt 5 does not have -no-stl.

Task-number: QTBUG-35424
Change-Id: Id449d807eaf7350f1a668ef16d356a9e236c6058
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>