Limit proxy/memcached/fastcgi/scgi/uwsgi upstream tries times

Add proxy/memcached/fastcgi/scgi/uwsgi_upstream_tries directives which can limit proxy/memcached/fastcgi/scgi/uwsgi upstream tries times. These directives can work in main/server/location configs, and are disabled by default(default behavior is to try ALL upstreams). Partial code is
forked from patch: https://gist.github.com/shai-d/5446961.