Serialize postgres' hstore, json and array types correctly in AR update methods. Fixes #12261