Arrange to fsync the contents of lockfiles (both postmaster.pid and the socket lockfile) when writing them.  The lack of an fsync here may well explain two different reports we've seen of corrupted lockfile contents, which doesn't particularly bother the running server but can prevent a new server from starting if the old one crashes.  Per suggestion from Alvaro.
Arrange to fsync the contents of lockfiles (both postmaster.pid and the
socket lockfile) when writing them.  The lack of an fsync here may well
explain two different reports we've seen of corrupted lockfile contents,
which doesn't particularly bother the running server but can prevent a
new server from starting if the old one crashes.  Per suggestion from
Alvaro.

Back-patch to all supported versions.

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