build fixes

I was testing the latest libuv for a new project and found a few issues in the process. Please consider these fixes for distribution tarballs and newer mingw builds.