Escape line return characters while serializing strings to Lua