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