Clear error_context_stack and debug_query_string at the beginning of proc_exit, so that we won't try to attach any context printouts to messages that get emitted while exiting.  Per report from Dennis Koegel, the context functions won't necessarily work after we've started shutting down the backend, and it seems possible that debug_query_string could be pointing at freed storage as well.  The context information doesn't seem particularly relevant to such messages anyway, so there's little lost by suppressing it.
Clear error_context_stack and debug_query_string at the beginning of proc_exit,
so that we won't try to attach any context printouts to messages that get
emitted while exiting.  Per report from Dennis Koegel, the context functions
won't necessarily work after we've started shutting down the backend, and it
seems possible that debug_query_string could be pointing at freed storage
as well.  The context information doesn't seem particularly relevant to
such messages anyway, so there's little lost by suppressing it.

Back-patch to all supported branches.  I can only demonstrate a crash with
log_disconnections messages back to 8.1, but the risk seems real in 8.0 and
before anyway.

zaksoup/gpdb,ashwinstar/gpdb,ahachete/gpdb,lisakowen/gpdb,adam8157/gpdb,royc1/gpdb,royc1/gpdb,Quikling/gpdb,CraigHarris/gpdb,rvs/gpdb,rvs/gpdb,xinzweb/gpdb,ashwinstar/gpdb,zaksoup/gpdb,jmcatamney/gpdb,chrishajas/gpdb,ashwinstar/gpdb,lintzc/gpdb,xinzweb/gpdb,edespino/gpdb,greenplum-db/gpdb,zaksoup/gpdb,lisakowen/gpdb,zaksoup/gpdb,Quikling/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,edespino/gpdb,cjcjameson/gpdb,CraigHarris/gpdb,rvs/gpdb,edespino/gpdb,yuanzhao/gpdb,yuanzhao/gpdb,kaknikhil/gpdb,royc1/gpdb,xuegang/gpdb,lintzc/gpdb,50wu/gpdb,ashwinstar/gpdb,royc1/gpdb,zaksoup/gpdb,xinzweb/gpdb,xuegang/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,rvs/gpdb,Chibin/gpdb,kaknikhil/gpdb,cjcjameson/gpdb,janebeckman/gpdb,adam8157/gpdb,edespino/gpdb,xuegang/gpdb,rvs/gpdb,kaknikhil/gpdb,lisakowen/gpdb,0x0FFF/gpdb,Quikling/gpdb,edespino/gpdb,CraigHarris/gpdb,lisakowen/gpdb,yuanzhao/gpdb,50wu/gpdb,0x0FFF/gpdb,lintzc/gpdb,0x0FFF/gpdb,lisakowen/gpdb,royc1/gpdb,adam8157/gpdb,ahachete/gpdb,Chibin/gpdb,janebeckman/gpdb,kaknikhil/gpdb,Chibin/gpdb,ahachete/gpdb,ashwinstar/gpdb,kaknikhil/gpdb,greenplum-db/gpdb,cjcjameson/gpdb,rvs/gpdb,50wu/gpdb,kaknikhil/gpdb,lisakowen/gpdb,Quikling/gpdb,50wu/gpdb,yuanzhao/gpdb,janebeckman/gpdb,royc1/gpdb,royc1/gpdb,jmcatamney/gpdb,rvs/gpdb,ahachete/gpdb,xinzweb/gpdb,edespino/gpdb,jmcatamney/gpdb,xuegang/gpdb,xuegang/gpdb,Quikling/gpdb,Quikling/gpdb,janebeckman/gpdb,50wu/gpdb,lintzc/gpdb,yuanzhao/gpdb,janebeckman/gpdb,Quikling/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,janebeckman/gpdb,kaknikhil/gpdb,lisakowen/gpdb,zaksoup/gpdb,CraigHarris/gpdb,jmcatamney/gpdb,chrishajas/gpdb,CraigHarris/gpdb,chrishajas/gpdb,0x0FFF/gpdb,edespino/gpdb,adam8157/gpdb,chrishajas/gpdb,edespino/gpdb,greenplum-db/gpdb,Chibin/gpdb,edespino/gpdb,0x0FFF/gpdb,xuegang/gpdb,Quikling/gpdb,greenplum-db/gpdb,0x0FFF/gpdb,kaknikhil/gpdb,xinzweb/gpdb,chrishajas/gpdb,Chibin/gpdb,janebeckman/gpdb,Chibin/gpdb,Chibin/gpdb,janebeckman/gpdb,royc1/gpdb,cjcjameson/gpdb,janebeckman/gpdb,rvs/gpdb,lintzc/gpdb,ahachete/gpdb,Quikling/gpdb,adam8157/gpdb,cjcjameson/gpdb,ahachete/gpdb,Chibin/gpdb,zaksoup/gpdb,kaknikhil/gpdb,rvs/gpdb,chrishajas/gpdb,adam8157/gpdb,lintzc/gpdb,xinzweb/gpdb,50wu/gpdb,greenplum-db/gpdb,zaksoup/gpdb,CraigHarris/gpdb,0x0FFF/gpdb,xinzweb/gpdb,edespino/gpdb,jmcatamney/gpdb,lintzc/gpdb,xuegang/gpdb,CraigHarris/gpdb,jmcatamney/gpdb,xuegang/gpdb,Chibin/gpdb,adam8157/gpdb,CraigHarris/gpdb,yuanzhao/gpdb,ahachete/gpdb,chrishajas/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,lisakowen/gpdb,50wu/gpdb,50wu/gpdb,rvs/gpdb,cjcjameson/gpdb,jmcatamney/gpdb,janebeckman/gpdb,ahachete/gpdb,ashwinstar/gpdb,Quikling/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,adam8157/gpdb,cjcjameson/gpdb,greenplum-db/gpdb,xuegang/gpdb,chrishajas/gpdb,lintzc/gpdb,ashwinstar/gpdb,Chibin/gpdb,0x0FFF/gpdb,kaknikhil/gpdb,xinzweb/gpdb,CraigHarris/gpdb,lintzc/gpdb