Use gssalloc_malloc for GSS error tokens

In kg_accept_krb5, use gssalloc_malloc when allocating space for the
error token, since it will be freed with gssalloc_free.  Using malloc
can cause heap corruption on Windows.  This bug was masked by #1445
before 1.12.

ticket: 8024 (new)
target_version: 1.13.1
tags: pullup
Document that newer AFS supports stronger crypto

Modern OpenAFS releases support using encryption stronger than single
DES with Kerberos.  Update the documentation accordingly.

ticket: 7761
target_version: 1.13
tags: pullup
Separate ccache display and checking in klist

In klist, use separate functions to display a ccache and check its
status.  Also use a helper function to check if a credential's server
principal is the local krbtgt principal for the realm.
Improve klist check for expired cache

Make klist -s succeed for a cache which contains a non-expired
credential and no TGT cred.

ticket: 8022
Fix klist -A -s output

In show_all_ccaches, don't output newlines if status_only is set.
Add tests for klist -s
Remove KRB5_TC_OPENCLOSE handling in FILE ccache

Stop processing the KRB5_TC_OPENCLOSE flag in cc_file.c; always reopen
the file instead.  This will be replaced with more efficient cursor
handling.  Also remove some unused KRB5_TC_OPENCLOSE macros in scc.h.
Stop using KRB5_TC_OPENCLOSE

Since KRB5_TC_OPENCLOSE no longer does anything, stop setting it when
we iterate over ccaches.  In klist, use KRB5_TC_NOTICKET instead since
we don't need the ticket session key.

(XXX Windows code not changed yet)

ticket: 7804
Remove cc_file.c global lookup table

The FILE ccache type maintains a global reference-counted table of
handles, which is perhaps an imperfect workaround for POSIX
per-process file locks.  Remove this table, since we plan to maintain
read fds in cursors and use O_APPEND writes to render locking less
important.
Revamp FILE ccache I/O handling

Remove open file state from the cache handle, use stdio for reading,
use single O_APPEND writes for writing, and use O_CLOEXEC when
opening.  This simplifies the code, fixes some concurrency issues, and
reduces the dependency on POSIX locks (although we still acquire them
for compatibility with older code, or in case O_APPEND writes aren't
concurrency-atomic).

Helper functions change as follows:
* open_cache_file yields a stdio handle, and only opens and locks.
* close_cache_file takes a stdio handle.
* read_header (new) reads the file header and yields a version.
* invalidate_cache and fcc_lseek are no longer needed.
* get_size, read_bytes, and load_bytes operate on a stdio handle.
* read32, read16, load_data, load_principal, and load_cred operate on
  a stdio handle and version.
* write_bytes, store32, store16, and store_principal are no longer
  needed.

fcc_initialize now takes responsibility for writing the header and
principal using a single write.  The cache cursor now stores a stdio
handle to avoid having to reopen the file for each cred, and therefore
now requires a mutex.