Fix lo_import and lo_export to return useful error messages more often.
Fix lo_import and lo_export to return useful error messages more often.

I found that these functions tend to return -1 while leaving an empty error
message string in the PGconn, if they suffer some kind of I/O error on the
file.  The reason is that lo_close, which thinks it's executed a perfectly
fine SQL command, clears the errorMessage.  The minimum-change workaround
is to reorder operations here so that we don't fill the errorMessage until
after lo_close.

postmind-net/postgres-xl,arcivanov/postgres-xl,postmind-net/postgres-xl,snaga/postgres-xl,arcivanov/postgres-xl,arcivanov/postgres-xl,kmjungersen/PostgresXL,snaga/postgres-xl,snaga/postgres-xl,snaga/postgres-xl,arcivanov/postgres-xl,kmjungersen/PostgresXL,kmjungersen/PostgresXL,kmjungersen/PostgresXL,postmind-net/postgres-xl,kmjungersen/PostgresXL,postmind-net/postgres-xl,arcivanov/postgres-xl,snaga/postgres-xl,postmind-net/postgres-xl,arcivanov/postgres-xl