Fix SEGFAULT after evdns_base_resume if no nameservers installed.

If there is no nameservers installed, using
evdns_base_nameserver_ip_add(), than evdns_base_resume() will SEGFAULT,
because of NULL dereference in evdns_requests_pump_waiting_queue()
Add tests for evdns_base_resume().

- leak_resume
- leak_cancel_and_resume
- leak_resume_send_err
- leak_cancel_and_resume_send_err
Fix dns/leak_resume_send_err test.

Because we don't cancel request,
and want our callback to recieve DNS_ERR_SHUTDOWN,
we use deferred callback, and there was
- one extra malloc(),
  @see reply_schedule_callback()
- and one missing free
  @see request_finished() (req->handle->pending_cb = 1)
than we don't need to count in testleak_cleanup()

So just decrement allocated_chunks to 2,
like we already take care about it.
Avoid redundant syscall to make a nonblocking socket nonblocking
Avoid redundant syscall if making a socket cloexec twice

I got the idea from Maxime's last patch.
Fix a double close() bug in evhttp when the underlying bufferevent uses BEV_OPT_CLOSE_ON_FREE.
Fix locking in bufferevent_get_options_().
Remove a debugging assert that should not have been left in
Merge remote-tracking branch 'origin/pr/62'