Indroduce lockfree stack into core library

With the help of lockfree stack, we can be easy to implement
lockfree algorithm when working on shared memory.

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>
Add "ngx_process_idx" global variable for worker processes

It's useful to use "ngx_process_slot" as index to fetch worker's
private data in shared memory.

But unfortunately, the value of "ngx_process_slot" among all workers
could become inconsecutive when nginx was reloaded or crashed.

This patch will add "ngx_process_idx" global variable for nginx,
the value of "ngx_process_idx" will be in range [0, (N-1)], where
N is the number of woker processes, of course it'll always be
consecutive, so can be used as index safely.

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>
To share keepalive connections across all workers

Changes in V4:
 - Fix bug about initializing srv->idle_list.
 - Check process status before accessing shared memory.
 - Continue to fix some coding style.
 - Use ngx_process_idx as index when access idle_list.
 - Reclaim connection into idle_list when send fd failed.

Changes in V3:
 - Adjust some coding style.
 - Remvoe zero array in keepalive_shared_srv_t.
 - Remove assert().
 - Fix ngx_channel_handler().
 - Ignore connections when its owner process is dead.
 - Delete old shared memory when relaod Tengine.

NOTE: Please use 'git am --scissors xxx.patch' to remove these
      comments before scissors line when merging patches.
------------------------------------------------------------->8

In order to limit the number of connections for each upstream, it's
worth to share keepalive connections across all workers, so that idle
connections could be reused effectively by other workers.

* Features:
  - All operations on shared memory are lockfree, workers will hardly
    ever block each other.

  - To get idle keepalive connection from worker's local pool firstly,
    which could avoid unnecessarily transferring socket fd between workers.

  - Add "shared" option for upstream's "keepalive" directive. We can use
    this option to enable shared keepalive connections:

        http {
            upstream abc {
                ...;
                keepalive n shared;
                ...;
            }
        }

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>
Use binary search to lookup upstream servers