Backport the SQLITE_PROTOCOL fix and the extra defensive measure to version
3.7.4.
Backport the changes of checkin [cf86affcb7d308949]
("Make wal_checkpoint a no-op if a prior checkpoint has already copied
all WAL content into the database.") to the 3.7.4 release.
Backport the sqlite3.h generator fix so that it works with newer versions
of Fossil.  See [3513bf6ee090d9b] for the original.
Do not raise an SQLITE_CORRUPT error in Recoverymode if the database size
in the header is larger than the physical file size.  This is a cherrypick
of checkin [114640d920e16c8]
Make sure the change-counter and SQLite-version fields of the header are
set correctly even after vacuuming.  This is a backport of changes
[0be92a7576] and [04fa1e1690] to address ticket [5de63f876cc].
Do not report the database corruption if the the db size header field is 
greater than the file size on disk unless the two change-counter header
fields are identical.  Fix for ticket [89b8c9ac54].  Backport by cherrypick
of [00c4596f0b270].
Pull in the fix to STAT2 processing from check-in
[70a3d81742f].
Backport the os_unix.c error logging enhancements from
check-in [01076528a43b61a].
Automatically retry system calls that fail with EINTR.  This is a backport
of the changes from [b9d29ea385bafc] and [af9ba2a6d2c379].