libdtoa: fixed handling of NaN and Infinity

otherwise we print thousands of 00000 characters