Fix for maximum number of loops applied even if set to unlimited

Change-Id: I588b6f0a9ac393051f71bbe97717074c8a53a9b5
ExtLoops::maxLoopsPerformed was buggy. It has to check the config var, not the loop counter.