Treat Z_BUF_ERROR as TOR_ZLIB_BUF_FULL when finalizing a zlib buffer

Otherwise, when we're out of input *and* finalizing, we might report
TOR_ZLIB_OK erroneously and not finalize the buffer.

(I don't believe this can happen in practice, with our code today:
write_to_buf_zlib ensures that we are never trying to write into a
completely empty buffer, and zlib says "Z_OK" if you give it even
one byte to write into.)

Fixes bug 11824; bugfix on 0.1.1.23 (06e09cdd47eaa8f7e90ce2).
Refactor pending_cb_message_t into a type with proper functions

Also, rename it.
Turn log loop into a for loop, and "Does this lf want this" into a fn
Refactor the 'deliver a log message' logic to its own function.
Remember log messages that happen before logs are configured

(And replay them once we know our first real logs.)

This is an implementation for issue 6938.  It solves the problem of
early log mesages not getting sent to log files, but not the issue of
early log messages not getting sent to controllers.
Send back SOCKS5 errors for all of the address related failures.

Cases that now send errors:
 * Malformed IP address (SOCKS5_GENERAL_ERROR)
 * CONNECT/RESOLVE request with IP, when SafeSocks is set
   (SOCKS5_NOT_ALLOWED)
 * RESOLVE_PTR request with FQDN (SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED)
 * Malformed FQDN (SOCKS5_GENERAL_ERROR)
 * Unknown address type (SOCKS5_ADDRESS_TYPE_NOT_SUPPORTED)

Fixes bug 13314.
Define a strnlen replacement on platforms (win32) that lack it

Right now this is only needed for test_util_format_time_interval, so
define it as a static function.  We can move it into compat later if
we need to.
Emit fewer spurious lines in cov-diff output.
Disable SSLv3 unconditionally. Closes ticket 13426.

The POODLE attack doesn't affect Tor, but there's no reason to tempt
fate: SSLv3 isn't going to get any better.
Merge branch 'no_sslv3_023' into maint-0.2.3
Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4
Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5
Merge remote-tracking branch 'origin/maint-0.2.5'
Merge remote-tracking branch 'yawning/bug13314'
Downgrade 'unexpected sendme cell from client' to PROTOCOL_WARN

Closes 8093.
Merge remote-tracking branch 'origin/maint-0.2.5'
Use correct day of year in correct_tm()

Set the correct day of year value in correct_tm() when the
system's localtime(_r) or gmtime(_r) functions fail to set struct tm.

Fixes bug 13476.
Improve date validation in HTTP headers

Check all date/time values passed to tor_timegm
and parse_rfc1123_time for validity, taking leap
years into account.
Improves HTTP header validation.

Avoid unlikely signed integer overflow in tor_timegm
on systems with 32-bit time_t.
Fixes bug 13476.
format_changelog.py: learn about the ReleaseNotes format
Clamp (some) years supplied by the system to 1 CE

Clamp year values returned by system localtime(_r) and
gmtime(_r) to year 1. This ensures tor can read any
values it might write out.

Fixes bug 13476.