cosmetics, define feature macros to be able to use strdup() and friends

- strcasecmp() (src/onion/dict.c)  requires _BSD_SOURCE
- strdup() (src/onion/onion.c)  requires _XOPEN_SOURCE>=500 or _BSD_SOURCE
- pthread_rwlocK_t (src/onion/types_internal.h)  requires _XOPEN_SOURCE>=500
- getline() (examples/otop/otop.c)  requires _GNU_SOURCE
cosmetics, always guard definition of _GNU_SOURCE macro

Some compilers are allergic to redefinitions of the _GNU_SOURCE macro
if the macro body isn't literally identical to the previous definition.

This patch guards against redefinitions.
cosmetics, adhere to POSIX signal() signature

POSIX mandates the second argument of signal() be of type void(*)(int), so
this changeset adapts the callback routines (free_onion()) to adhere to
POSIX' declaration.
Merge pull request #28 from hroptatyr/bld/non-gcc

[pull-req] bld/non gcc, facilitate icc builds
C++ dict allows a map<string,string> as constructor argument, easing construction using {{key,value}} from C++11 maps.
Merge branch 'master' of github.com:davidmoreno/onion
Check for calloc() failure to prevent segmentation fault in onion_new()

Previously in the function onion_new(), the onion* object would be allocated via calloc() then immediately put to use (e.g. o->flags=...). If calloc() fails (e.g. when out of memory), this will result in a segmentation fault. This commit checks if the allocation succeeded and, if it did not, returns NULL.
Merge pull request #29 from Luiji/patch-1

Check for calloc() failure to prevent segmentation fault in onion_new()
Added date header on responses, to fit better on http requirements.

It is not really mandatory, but now its more compilant. It uses a small cache
and a rw lock. It give aprox. a 1.1% perfomance penalty.
Merge branch 'master' of github.com:davidmoreno/onion
Log when no info is set will not get slow information needed for info (client ip address). Just a speedup hack.
Fixed slow on some obviour condition when writing a fixed string and send the petition. Now enforces response_set_length when handler returns and no headers sent yet.
Created test to assert that the proper assets file is created after opack and otemplate. Updated otemplate to generate assets files.
Added support for C type handers on C++ Onion::Url objects.
Added add standard C onion_handler as a handler at C++ urls. This allows easy use of C style handlers, as webdav or static files.
Added c++ compatibility to mime.h.
Fixed log.c to do the casting properly to work on openbsd.
Fixed define guards at all headers. Now it complies with DCL37-C. Fixes bug #34.
Fixed handler.h header for DCL37-C compilance.
Fixed some check return for error allocating memory and thread creation. Fixes #35.