Merge of r4992: off-by-one with 32/64 upstream backup servers.

Fixed off-by-one during upstream state resetting when switching to
backup servers if there were exactly 32 (64 on 64-bit platforms)
backup servers configured.

Based on patch by Thomas Chen (ticket #257).


git-svn-id: svn://svn.nginx.org/nginx/branches/stable-1.2@5056 73f98a42-aea0-e011-b76d-00259023448c
Merge of r4999, r5003: detect duplicate "events" and "keepalive".

*) Upstream keepalive: detect duplicate "keepalive" directive.  A
   failure to detect duplicate "keepalive" directive resulted in
   stack exhaustion.

*) Events: added check for duplicate "events" directive.


git-svn-id: svn://svn.nginx.org/nginx/branches/stable-1.2@5057 73f98a42-aea0-e011-b76d-00259023448c
Merge of r5001: year 2013.


git-svn-id: svn://svn.nginx.org/nginx/branches/stable-1.2@5058 73f98a42-aea0-e011-b76d-00259023448c