Fix arithmetic exception when pass an empty mat with IPP option on.

This PR fixes Itseez/opencv_contrib#71. Currently some methods in stat.cpp causes arithmetic exception when empty matrix is passed with IPP option on, I fixed it by preventing zero-division.