Escape carriage return when round-tripping

Previously the carriage return character ("\r") was not round-tripped
properly.

This will cause a warning on the (upcoming) Ruby 2.1.0 as a plain
carriage return that is not at end-of-line is treated as a space.