Don't change values in `@raw_attributes` during serialization

During `init_with`, the attributes given to the coder will be placed
into `@raw_attributes`. As such, we should read from `@raw_attributes`
when encoding, rather than `@attributes`, which has been type cast.
Merge pull request #15432 from sgrif/sg-coder-type-casting

Don't change values in `@raw_attributes` during serialization