MOBI metadata: Handle cover/thumbnail exth fields with null pointers

MOBI metadata: Do not fail to set metadata in MOBI files if they have
EXTH fields with NULL pointers to a cover or thumbnail. Fixes #1205757 [Metadata edits not sticking](https://bugs.launchpad.net/calibre/+bug/1205757)
pep8
calibredb: Add a new clone command

calibredb: Add a new clone command to create clones of libraries with
the same custom columns, virtual libraries, etc. as the current library.
Add has_id() to db.data in the new backend

Also speed up has_id() and all_book_ids()
Fix test failures caused by removal of virtual fields from get_metadata
...
Fix apsw not included in linux binary builds
newdb: Fix undefined custom dates not displaying as blank, depending on time zone
newdb: Enable sorting on the marked field for the find duplicated plugin
newdb: Do not cache searches that search on virtual fields like marked,
since there is no safe way to update such a cache.
Do not search virtual fields on when searching 'all'

Searching virtual fields (such as marked) ona prefix less search
disables search caching.
Ensure that undefined datetimes are always written as UNDEFINED_DATE to
the db
oops
...
Device drivers: Explicitly fsync() all files when writing to devices
...
plugin for ebooki.allegro.pl
newdb: Fix sorting of view not stable
Factor out the code to update the GUI, so it can be re-used
newdb: Speed up set_metadata() by not committing the db after individual field writes