CMake fixes for building with mingw

- Only use /usr/src/gtest if not building for Windows.
  On debian the gtest includes are placed in /usr/include, which is not
  in the compiler search path for mingw

- Change test platform liner inputs, so that ws2_32 appears at the end

- Build gtest as a static library on mingw; this allows the library to
  build with -static-libgcc

Change-Id: Ic4ecf24387db5ca87c1320b3cc8da1af869de196
Reviewed-on: http://review.couchbase.org/42767
Tested-by: Mark Nunberg <mnunberg@haskalah.org>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>