Fix Windows-specific race condition in syslogger. This could've been the cause of the "could not write to log file: Bad file descriptor" errors reported at http://archives.postgresql.org//pgsql-general/2008-06/msg00193.php
Fix Windows-specific race condition in syslogger. This could've been
the cause of the "could not write to log file: Bad file descriptor"
errors reported at
http://archives.postgresql.org//pgsql-general/2008-06/msg00193.php

Backpatch to 8.3, the race condition was introduced by the CSV logging
patch.

Analysis and patch by Gurjeet Singh.

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