Avoid multiple free_struct_lconv() calls on same data.
Avoid multiple free_struct_lconv() calls on same data.

A failure partway through PGLC_localeconv() led to a situation where
the next call would call free_struct_lconv() a second time, leading
to free() on already-freed strings, typically leading to a core dump.
Add a flag to remember whether we need to do that.

Per report from Thom Brown.  His example case only provokes the failure
as far back as 9.4, but nonetheless this code is obviously broken, so
back-patch to all supported branches.

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