[SPARK-2515][mllib] Chi Squared test

The first case is a valid test so we should return a result with `pValue = 0`. But the second case is not valid because 0/0 is undefined. I prefer throwing an exception in the second case.