Fix compiler warnings on Cygwin and Mac OS X.

* Don't use PIE/PIC on Cygwin/Darwin unless specified as these
  platforms don't support it.
* Cleanup warnings for 'make check' build.
* Fix the type issue for getsockopt calls.
* Fix enum warnings in Yahoo libs on Mac OS X.
Replace isdigit/isalpha/.../tolower/toupper with glib variants

This fixes warnings about passing signed chars to them (apparently they
are implemented as macros that do array lookups without checks in some
platforms, yay)

Specifically:

    functions=isalnum|isalpha|isdigit|isspace|isxdigit|tolower|toupper
    sed -ir "s/$functions/g_ascii_&/g" **/*.c