windows: use '-l<library>' form in gyp file

This fixes the build with MinGW32.
windows: fix mingw32/debug build

Debug build failed on mingw32 because CRT assertion disable code was stubbed out.
Replace __declspec(thread) with UV_THREAD_LOCAL which is defined as __thread on GCC.