rosmsg2json: do not allow invalid JSON

See http://stackoverflow.com/questions/6601812/sending-nan-in-json