Fix building minidump processor for MinGW

This is a sub-set of changes in https://breakpad.appspot.com/548002/ with a bit
of updating

- Link minidump_stackwalk, minidump_dump with PTHREAD_LIBS as pthread_cancel is used
- Link minidump_stackwalk with ws2_32 as ntoh functions are used
- Fix wtypes.h include for case sensitive filesystems
- _s function variants should only be used if _MSC_VER, use _r variants with
MinGW (and define _POSIX to ensure they are prototyped)
- Don't try to include arpa/inet.h on Windows
Provide a working strtok_r on MinGW
Define NO_STABS_SUPPORT on windows

XXX: this should be an autoconf check
Fix building client library and upload tools for MinGW

This is the rest of https://breakpad.appspot.com/548002/, brought up to date

Mainly fix include filenames to be lowercased for case-sensitive filesystems

Removed usage of stdext::checked_array_iterator, which is a MSVC-only feature.

v2: Refine MinGW changes in HTTPUpload::GetFileContents so it closes file after
use
v3: For consistency, write conditioanls in terms of _MSC_VER, not __MINGW32__
Fix building windows client unit-tests with gcc

- MinGW doesn't have  _CrtSetReportMode

- Trying to call PureVirtual() on a base class object give a linker error

(Presumably gcc can see that base class will be used for virtual function call,
so requires  an implementation (which is prohibited because it's pure virtual)
at link time.)

XXX: crash_generatation_app manages to contain a pure virtual call without
tripping over this, so look how it does that...
Avoid O_BINARY redefinition warning on Cygwin

On Cygwin, WIN32 not defined, but O_BINARY is defined by fcntl.h, so avoid a
redefinition warning.

../src/processor/minidump.cc:55:0: warning: "O_BINARY" redefined [enabled by default]
 #define O_BINARY 0
 ^
In file included from /usr/include/sys/fcntl.h:3:0,
                 from /usr/include/fcntl.h:14,
                 from ../src/processor/minidump.cc:39:
/usr/include/sys/_default_fcntl.h:52:0: note: this is the location of the previous definition
 #define O_BINARY _FBINARY
 ^

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Remove local copy of curl headers

This reverts commit d9d863e153d12532fc85bd8b44bc47f079ed064c.
This reverts commit 68e380d5a73a0d657693f166fbcb1dd77027766b.