plperl: Correctly handle empty arrays in plperl_ref_from_pg_array.
plperl: Correctly handle empty arrays in plperl_ref_from_pg_array.

plperl_ref_from_pg_array() didn't consider the case that postgrs arrays
can have 0 dimensions (when they're empty) and accessed the first
dimension without a check. Fix that by special casing the empty array
case.

Author: Alex Hunsaker
Reported-By: Andres Freund / valgrind / buildfarm animal skink
Discussion: faac9a40fd713981b17c71899a10a8651c36bda9@alap3.anarazel.de
Backpatch: 9.1-

xinzweb/gpdb,ashwinstar/gpdb,adam8157/gpdb,adam8157/gpdb,xinzweb/gpdb,greenplum-db/gpdb,lisakowen/gpdb,jmcatamney/gpdb,lisakowen/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,adam8157/gpdb,adam8157/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,lisakowen/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,50wu/gpdb,jmcatamney/gpdb,adam8157/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,lisakowen/gpdb,adam8157/gpdb,50wu/gpdb,ashwinstar/gpdb,lisakowen/gpdb,jmcatamney/gpdb,adam8157/gpdb,xinzweb/gpdb,50wu/gpdb,jmcatamney/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,50wu/gpdb,xinzweb/gpdb,lisakowen/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,50wu/gpdb,lisakowen/gpdb,adam8157/gpdb,50wu/gpdb,xinzweb/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,50wu/gpdb,50wu/gpdb,xinzweb/gpdb,xinzweb/gpdb,jmcatamney/gpdb