Ensure `OID::Array#type_cast_for_database` matches PG's quoting behavior

Also takes a step towards supporting types which use a character other
than ',' for the delimiter (`box` is the only built in type for which
this is the case)
Merge pull request #15784 from sgrif/sg-delimiter

Ensure `OID::Array#type_cast_for_database` matches PG's quoting behavior