Fix json output when printing infinity values

The printf of a rrd_value_t variable can output inf in case of an
infinity value. That inf value is not JSON valid, nor are Infinity,
NaN, Number.NEGATIVE_INFINITY or Number.POSITIVE_INFINITY.

This commit adds a test for infinity values by using isinf() and
outputs a null in such case.