some improvements to pg-sync

I have made some improvements to pg-sync which make it possible to build on windows. Also it gives some more usefull information in case of an error and it fixes a crash when establishing a connection failed.