There is no need to include <openssl/e_os2.h> here, except for the fact
that it brings in <openssl/opensslconf.h>, so just do that instead
(currently via apps.h).
Make sure all error paths in dtls1_buffer_record() invoke SSLErr by
factoring error handling.

ok jsing@
tls_decrypt_ticket(): memory leak and uncleaned EVP_CIPHER_CTX upon error.
We don't really to keep history in constructs such as:

#if 1 /* new with openssl 0.9.4 */
current code;
#else
obsolete code;
#endif
Unchecked malloc() return value in SSL_COMP_add_compression_method(), in the
!OPENSSL_NO_COMP case. Does not affect OpenBSD as we compile the opposite code
path.
Replace the following logic:

        if (nothing to allocate)
                ptr = malloc(1)
        else {
                if ((ptr = malloc(size to allocate))
                        memcpy(ptr, data to copy, size to allocate)
        }

        if (ptr == NULL)
                OMG ERROR

with a saner logic where the NULL pointer check if moved to the actual
malloc branch, so that we do not need to malloc a single byte, just to avoid
having a NULL pointer.

Whoever thought allocating a single byte was a smart idea was obviously
not taking his meds.

ok beck@ guenther@
More KNF.
Remove MemCheck_{on,off} that escaped last time around.
Wrap some long lines.
Remove redundant test introduced in s3_pkt.c on 20001225, which got cargo-culted
(with an XXX comment, though) in d1_pkt.c in 2005.
Remove unused defines.
Fix a Y2038 problem, by conversion of long to time_t.

The TS_RESP_CTX_set_time_cb() API gets removed. Nothing in the greater
ecosystem ever calls it.  This API needs to be removed, because if
anyone ever calls on a BE 32 system assuming long rather than time_t,
it will be dangerously incompatible.

ok miod guenther
More KNF.
There is no point in checking if a pointer is non-NULL before calling free,
since free already does this for us. Also remove some pointless NULL
assignments, where the result from malloc(3) is immediately assigned to the
same variable.

ok miod@
EVP_MD_CTX_create() calls malloc and can return NULL. However, only one of
the calls in libssl actually checks the return value before using it. Add
NULL checks for the remaining three calls.

ok miod@
Refactor tls1_change_cipher_state() and split the compression handling out
from the cipher and message digest handling, allowing for upcoming changes.

Based on Adam Langley's chromium diffs.

ok miod@
More KNF.