Fix error handling in PLy_spi_execute_fetch_result().
Fix error handling in PLy_spi_execute_fetch_result().

If an error is thrown out of the datatype I/O functions called by this
function, we need to do subtransaction cleanup, which the previous coding
entirely failed to do.  Fortunately, both existing callers of this function
already have proper cleanup logic, so re-throwing the exception is enough.

Also, postpone creation of the resultset tupdesc until after the I/O
conversions are complete, so that we won't leak memory in TopMemoryContext
when such an error happens.

adam8157/gpdb,oberstet/postgres-xl,xinzweb/gpdb,greenplum-db/gpdb,50wu/gpdb,zeroae/postgres-xl,jmcatamney/gpdb,yazun/postgres-xl,50wu/gpdb,xinzweb/gpdb,50wu/gpdb,ovr/postgres-xl,ashwinstar/gpdb,Postgres-XL/Postgres-XL,Postgres-XL/Postgres-XL,ashwinstar/gpdb,techdragon/Postgres-XL,zeroae/postgres-xl,jmcatamney/gpdb,greenplum-db/gpdb,adam8157/gpdb,50wu/gpdb,lisakowen/gpdb,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,pavanvd/postgres-xl,lisakowen/gpdb,pavanvd/postgres-xl,adam8157/gpdb,lisakowen/gpdb,oberstet/postgres-xl,techdragon/Postgres-XL,pavanvd/postgres-xl,50wu/gpdb,xinzweb/gpdb,jmcatamney/gpdb,oberstet/postgres-xl,greenplum-db/gpdb,Postgres-XL/Postgres-XL,techdragon/Postgres-XL,ashwinstar/gpdb,xinzweb/gpdb,50wu/gpdb,yazun/postgres-xl,oberstet/postgres-xl,greenplum-db/gpdb,Postgres-XL/Postgres-XL,yazun/postgres-xl,yazun/postgres-xl,jmcatamney/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,adam8157/gpdb,xinzweb/gpdb,xinzweb/gpdb,adam8157/gpdb,ovr/postgres-xl,techdragon/Postgres-XL,oberstet/postgres-xl,ashwinstar/gpdb,ovr/postgres-xl,adam8157/gpdb,greenplum-db/gpdb,ovr/postgres-xl,techdragon/Postgres-XL,ashwinstar/gpdb,Postgres-XL/Postgres-XL,ashwinstar/gpdb,ashwinstar/gpdb,lisakowen/gpdb,adam8157/gpdb,zeroae/postgres-xl,greenplum-db/gpdb,50wu/gpdb,yazun/postgres-xl,pavanvd/postgres-xl,jmcatamney/gpdb,jmcatamney/gpdb,ovr/postgres-xl,adam8157/gpdb,lisakowen/gpdb,pavanvd/postgres-xl,lisakowen/gpdb,zeroae/postgres-xl,jmcatamney/gpdb,xinzweb/gpdb,lisakowen/gpdb,50wu/gpdb,zeroae/postgres-xl,jmcatamney/gpdb