add an alias for poll and implement pipe in terms of sockets
don't call pthread_sigmask on windows (MingW defines it as a no-op anyway)
remove some C++ remnants
support building a DLL (needs --disable-stack-protector right now)