Fix race condition in DNS events.
Improve error reporting for HTTP sessions.