fixed assertion failure (vector out of range) for the 'vc10,debug' build

http://code.opencv.org/issues/2775

The bug was in the ts module (its perf part).