Use type pgsocket for Windows pipe emulation socket calls

This prevents several compiler warnings on Windows.