Fix encoding of arrays with pgsql_extended_query

Arrays were not properly encoded. Previously, all arrays were encoded in text
format and arrays of text were not properly escaped. Since Erlang binaries
could be BYTEA or TEXT and the binary format of arrays requires the type of
array elements, the protocol was altered to ask the backend for the type of
parameters (only when trying to encode arrays with binaries).