Configure: fixed nginx.so rebuild (broken by r5145).

To avoid further breaks it's now done properly, all the dependencies
are now passed to Makefile.PL.  While here, fixed include list passed to
Makefile.PL to use Makefile variables rather than a list expanded during
configure.
Upstream: fixed $upstream_response_length without buffering.

Reported by Piotr Sikora.
Events: protection from stale events in eventport and devpoll.

Stale write event may happen if read and write events was reported both,
and processing of the read event closed descriptor.

In practice this might result in "sendfilev() failed (134: ..." or
"writev() failed (134: ..." errors when switching to next upstream server.

See report here:
http://mailman.nginx.org/pipermail/nginx/2013-April/038421.html
Events: handle only active events in eventport.

We generate both read and write events if an error event was returned by
port_getn() without POLLIN/POLLOUT, but we should not try to handle inactive
events, they may even have no handler.
Events: fixed typos in two previous commits.
Upstream: warn if multiple non-stackable balancers are installed.
Request body: only read body in main request (ticket #330).

Before 1.3.9 an attempt to read body in a subrequest only caused problems
if body wasn't already read or discarded in a main request.  Starting with
1.3.9 it might also cause problems if body was discarded by a main request
before subrequest start.

Fix is to just ignore attempts to read request body in a subrequest, which
looks like right thing to do anyway.
Events: backout eventport changes (r5172) for now.

Evenport method needs more work.  Changes in r5172, while being correct,
introduce various new regressions with current code.
nginx-1.3.16-RELEASE
Version bump.
Configure: uniformly refer to libs when searching for md5 and sha1.
Configure: fixed perl Makefile generation (ticket #334).

Dependancy tracking introduced in r5169 were not handled absolute path
names properly.  Absolute names might appear in CORE_DEPS if --with-openssl
or --with-pcre configure arguments are used to build OpenSSL/PCRE
libraries.

Additionally, revert part of r5169 to set NGX_INCS from Makefile
variables.  Makefile variables have $ngx_include_opt in them, which
might result in wrong include paths being used.  As a side effect,
this also restores build with --with-http_perl_module and --without-http
at the same time.
Perl: request body handling fixed.

As of 1.3.9, chunked request body may be available with
r->headers_in.content_length_n <= 0.  Additionally, request body
may be in multiple buffers even if r->request_body_in_single_buf
was requested.
SPDY: set NGX_TCP_NODELAY_DISABLED for fake connections.

This is to avoid setting the TCP_NODELAY flag on SPDY socket in
ngx_http_upstream_send_response().  The latter works per request,
but in SPDY case it might affect other streams in connection.
Version bump.
nginx-1.4.0-RELEASE
Merge pull request #1 from joyent/master

merge from upstream