Fix bug #3678 (cuda::integral failures)

http://code.opencv.org/issues/3678