Restore foreach macro for GCC 4.3 and 4.4 in C++11 mode

In C++98, typename can only be used for argument-dependent types and
that's not the case here. This was tracked as language defect 382 and
was fixed in the final C++11 standard, but the fix didn't make it to GCC
4.3 and 4.4 (which do have decltype).

qthreadpool.cpp:274: error: using 'typename' outside of template

Task-number: QTBUG-40783
Change-Id: I0eb702b33d2e8c95284f52841b0021dbfc743874
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>