Fix a segmentation fault that was reproducible with curl's test #9

The issue was previously reported by Ming Fu and David Röthlisberger.

Patch taken from here :-
http://article.gmane.org/gmane.comp.web.polipo.user/3013
Stop asserting that released objects have no condition handlers

The assertions were reproducible triggered by curl's test 9.

Patch taken from here :-
http://article.gmane.org/gmane.comp.web.polipo.user/3013
Do not call httpServerDoSide() from httpClientDelayedDoSideHandler() with a NULL request

Prevents a segfault reproducible with curl's test 1129.

Patch taken from here :-
http://article.gmane.org/gmane.comp.web.polipo.user/3013
Fix a couple of memory leaks in httpParseHeaders()

Patch taken from here :-
http://article.gmane.org/gmane.comp.web.polipo.user/3013
Fix a crash due to brittle va_lists on x86_64

The problem is that va_lists are handled in a brittle way by x86_64 and
need to be copied whenever even a small breeze blows. More info:-
http://www.bailopan.net/blog/?p=30

More information on this patch is here :-
http://article.gmane.org/gmane.comp.web.polipo.user/2931

+ Non-author changes to origial patch:

The patch was originally against Polipo-1.0.4.1 but has been altered
slightly so as to be compatible with the the master branch.
Fix warning: redefinition of 'HAS_STDINT_H'

Signed-off-by: Alexsander Akers <a2@pandamonia.us>
Fix implementation of memrchr

Signed-off-by: Alexsander Akers <a2@pandamonia.us>

  + Non-author changes to origial patch:
  * Trailing whitespace deleted.
Externalize 'fdEventNum'

Signed-off-by: Alexsander Akers <a2@pandamonia.us>
Allow POST /config? to actually work

The 303 redirect seems to rather kludgy in that it reuses the POST's
object etc. to generate the redirect response.  Additionally the handler
seems to abort needlessly because the object doesn't get marked as
'INPROGRESS' whenever the post body is available in full.

  + Non-author changes to origial patch:

  * Trailing whitespace deleted.
Fix: httpSpecialClientSideHandler always returns a 502

Taken from Gabriel Kerneis' original patch here:-
http://article.gmane.org/gmane.comp.web.polipo.user/3006

httpSpecialClientSideHandler always returns "502 Incomplete client request"
even when the request is complete and handled correctly by httpSpecialDoSide.
Adds an authentication method for socks version 5. more specifically RFC1929

  + Non-author changes to origial patch:

  * Trailing whitespace deleted.
Assert request->fd is still valid to avoid crash with SIGPIPE
Ensure that the tunnel match is also protected by NO_FORBIDDEN.

+ Non-author changes to origial patch:

  * Added back the deleted blank line (minus the whitespace)
  * Surrounding whitespace deleted.
Don't use anything with PIDs in HAVE_FORK.
Protect a function by NO_FORBIDDEN.

+ Non-author changes to origial patch:

  * Whitespace deleted.
Minor fix for object.c
Stop uncachable resource being saved to disk

More information here :-
http://article.gmane.org/gmane.comp.web.polipo.user/3112
Make Extra Runtime Crash Analysis optional

This can be enabled by those that wish to have it.

Also add a blank line at the end of the main compiler options.
Add DCHUNK_SIZE to Makefile along with a description
Move $(EXTRA_DEFINES) from CFLAGS to DEFINES

It's seems more logical to have all the DEFINES subcomponents in the
same place.