Fix integer overflow in NL-Means denoising on white input 

This fixes [2646](http://code.opencv.org/issues/2646)