TS-2137: Use eventfd instread of pthread signal/wait in ATS

pthread_cond_signal/wait is used in several places in ATS, including but
not limited:
1) Logging system.
2) ProtectedQueue in event system.
3) RecProcess in stats system.

As we known, pthread_cond_signal() need to take lock, it'll cause
more context switch than eventfd.

In my testing:
1) Using _signal()/_wait() pair, eventfd is about 5 times faster than
   pthread cond.

2) Using _signal()/_timedwait() pair, eventfd is about 2 times faster
   than pthread cond.

== NOTE ==
pthread_cond_signal/wait is also used by AIO module, but we can't
simply replace it with eventfd, as AIO code use the mutex to protect
other stuff. And I found we can't replace it in ProtectedQueue directly,
there are some prepare work to do.

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>
TS-2141: Inconsistent euid cause bad mgmtapi/eventapi sockets

In the main function of traffic_manager, webIntr_main thread is created
after euid has been changed to "proxy.config.admin.user_id".

And then, webIntr_main thread will create mgmtapisocket/eventapisocket
socket fd, and listen on them.

But unfortunately, after created webIntr_main thread, the main thread
will call listenForProxy()->bindProxyPort() immediately, which might
change/restore euid concurrently.

For example:
1) bindProxyPort() change the euid to 0(root uid).

2) webIntr_main creates mgmtapisocket with 0 euid.

3) bindProxyPort() restore the euid to 501(admin.user_id)

4) webIntr_main calls chmod(0777) on mgmtapisocket, it'll get
   "Operation not permitted" error and other unexpected errors.

As the api sockets can't be created correctly, traffic_cop will failed to
establish heartbeat with traffic_manager, and than traffic_cop will kill
traffic_manager automatically.

But more worse, after killed and restarted manager, traffic_cop forgets to
reconnect to manager, so it will use bad main_socket_fd to detect heartbeat
of manager. Of course, it'll faill to detect and than kill/restart manager
again and again and again.

I'll give another patch to fix reconnect problem of traffic_cop which seems
casued by an old commit:ba95f9c6e8c49f69f018885f255db02f31d7335f.

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>
TS-2141: Make traffic_cop reconnect to manager correctly

1) By removing "TS_MGMT_OPT_NO_SOCK_TESTS" option when calls
   TSInit() in traffic_cop, cop will reconnect to manager correctly
   again.

2) Fix some small bugs about usage of pthread.

Signed-off-by: Yunkai Zhang <qiushu.zyk@taobao.com>