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.
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.
Further unit test tor_timegm and parse_rfc1123_time

Add unit tests for tor_timegm signed overflow,
tor_timegm and parse_rfc1123_time validity checks,
and correct_tm year clamping.
Unit tests (visible) fixes in bug 13476.
Memwipe more keys after tor has finished with them

Ensure we securely wipe keys from memory after
crypto_digest_get_digest and init_curve25519_keypair_from_file
have finished using them.

Fixes bug 13477.
Teach format_changelog to sort and collate sections.

Give it options to turn off collation and/or wrapping.
format_changelog.py: tweak hyphenation rules

Mark all our generated command names, and anything with a
double-hyphen, as unhyphenatable.
format_changelog.py: fix spelling of "hyphenatable"
format_changelog: Sort sections case-insensitively
Note that our #13426 fix is also a #13471 fix.

See also http://marc.info/?l=openssl-dev&m=141357408522028&w=2
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'
explain how to publish tarballs now that webwml has gone to git