Use system introspection for detecting isnan and isinf.

Instead of linking against libm, use system introspection to see if the isnan/isinf functions exists and are linkable, and if not use our own verison instead.

This solution defines our own _json_isnan function instead of redefining "isnan". If we do it that way, the macro definition in math.h for uclibc will still be there.

The system introspection for HAVE_ISNAN and HAVE_ISINF needs to be done for the automake project as well.