[SPARK-1779] Throw an exception if memory fractions are not between 0 and 1