T-API: improved performance of cv::matchTemplate

check_regression=*OCL_ImgSize_TmplSize_Method_MatchTemplate.MatchTemplate*