patch to support kqueue

Conflicts:
	configure.ac
	src/proto/nc_memcache.c
abstract out the event interface

Conflicts:
	src/Makefile.am
add nc_epoll.c nc_kqueue.c and  remove nc_event.c
Fix grammar in configure.ac
Remove core_core declaration from nc_core.h
Use EV_SET instead of memset and manually setting fields.
Get rid of extraneous local variables.
Fix bug in nc_kqueue.

Because of the way kqueue works, the returned event list can contain multiple entries for one connection/fd (e.g. one kevent for EVFILT_READ and one kevent for EVFILT_WRITE). This can result in a segfault where you first process the EVFILT_READ, decide that the client is sending bad data and close the connection (and freeing resources). Subsequently when you return to process the next kevent (the EVFILT_WRITE), you attempt to use the (freed) conn object pointed to by udata which fails.

The way we fix this is to walk the list of kevents waiting to be processed and zeroing out events that belong to connections we're about to close.
Add #include for nc_event.h to nc_stats.c so that we have the function prototype for evbase_create.
Provide support for platforms without backtrace support (e.g. FreeBSD).
Produce an error message when ./configure is run if neither epoll or kqueue is supported, instead of producing confusing link errors because both nc_epoll.c and nc_kqueue.c are empty.
Fix typo in configure.ac
Fix typo in define of NC_HAVE_BACKTRACE
Reverting bad commits
Fix typo
Reverting more bad commits.
Last bad commit reverted
Merge remote-tracking branch 'upstream/master' into kqueue_pull
Ensure that we don't evbase_destroy(NULL). Give evbase_destroy() the same semantics as free() - that is, passing a NULL pointer in is just a no-op.
Give nc_epoll.c:evbase_destroy() the same semantics as free() in that passing NULL in is a no-op.