ruby: make the special handling of NaN and Infinity an option of #to_simple_value

The current effort of splitting between #to_simple_value and
to_json_value was obviously broken (since #to_json_value was
not going to be called recursively), and fixing it with the same
philosophy would require some serious over-engineering. Simply
make this special handling an option and set the option accordingly
when calling #to_json_value