GPU TVL1 Optical Flow optimization

The same idea as in https://github.com/Itseez/opencv/pull/1345 (thanks to pengx17).

Do not calculate sum of error in every round of iteration; instead the error will be summed every 2nd times or more,  if the previous sum of error is too far away from threshold.