Throw invalid_argument when non-finite float value is given

Only finite float values are valid in JSON. If `json_float` has inf or nan, it create an invalid json string.