Use stdio reads, O_APPEND writes in FILE ccache

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.  Keep the file handle open during iteration.  These changes
simplify the code, fix some concurrency issues, and reduce the
dependency on POSIX file locks.  We still acquire file locks for
compatibility with older code, and 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
default client principal, using a single write.  The cache cursor now
requires a mutex to serialize access to the file handle.

ticket: 8026 (new)