T-API: fixed possible runtime error in cv::equalizeHist