Convert CDATA input to string before gsub'ing

Rails 3.2 API allowed arbitrary input for cdata_section; this change re-introduces the old behaviour.

If it is deemed worthy to be merged, does it make sense to add it to 4.0-STABLE as well?