Make all tests pass under EVENT_DEBUG_MODE=1

The fix was easy: the tests that were failing were those tests that
also enabled debug mode themselves. So, let them know when
EVENT_DEBUG_MODE is on, so they won't do that.
Implement event_finalize() and related functions to avoid certain deadlocks
Add some verbose notes to bufferevent unit tests
Use finalization feature so bufferevents can avoid deadlocks

Since the bufferevents' events are now EV_FINALIZE (name pending),
they won't deadlock.  To clean up properly, though, we must use the
finalization feature.

This patch also split bufferevent deallocation into an "unlink" step
that happens fast, and a "destruct" step that happens after
finalization.

More work is needed: there needs to be a way to specify a finalizer
for the bufferevent's argument itself.  Also, this finalizer business
makes lots of the reference counting we were doing unnecessary.

Also, more testing is needed.
Always run pending finalizers when event_base_free() is called

There was actually a bug in the original version of this: it tried to
run the finalizers after (potentially) setting current_base to NULL;
but those finalizers could themselves (potentially) be invoking stuff
that needed to know about the current event_base.  So the right time to
do it is _before_ clearing current_base.
Remove bufferevent_del_generic_timeout_cbs as now unused
More documentation for finalization feature
Make the event_finalize* functions return an error code
Remove a no-longer-true XXXX comment.
Merge branch '21_deadlock_fix_v2'
New test for active_later->active transition on event_active

When event_active is called, an active_later event is supposed to become
active now.  We had lacked a test for that.
New tests for event_base_foreach_event()

Our dump-events code had exercised this a bit, but only via the
nonlocking backend. Also, nothing was checking the "Search for a
specific event" code.
Unit tests for event_base_gettimeofday_cached() and event_base_update_cache_time()
A test for event_get_assignment()
More unit tests for initializing common timeouts.

Try with: misformed usecs in inputs, and with initializing common timeouts
from other common timeouts.
Fix a bug in the new main/event_foreach test

It wasn't making sure that the events weren't internal.
Clarify an important point about event_base_foreach_event()