Compare unserialized value when assigning serialized attributes to changed_attributes

This is my attempt at a fix for #12505.  Not certain that I put the test in the proper location, but it seemed like a logical spot.