Prevent video thumbnailer from hanging on malformed vids: Bug #741821

Bogus 100-byte file was causing video thumbnailer to hang during pre-
roll.  Failure to retrieve duration of video is a good clue that the
video itself is not valid for thumbnailing.
Add fingerprint column to PhotoTable and initial Fingerprint class for storing
a 256 bit (4 x uint64) fingerprint of each photo. The fingerprints are allowed
to be invalid, in case they have not yet been calculated (this allows
incremental upgrade), or in case the algorithm for calculating it fails for
some reason.

These 256 bit fingerprints can be used to calculate a difference measure
between pictures, by counting the number of bits that are different.

This patch only covers the database end. Calculation of the fingerprints,
as well as a user interface for listing similar pictures, will be done
in further separate patches.
Initial implementation of actual image fingerprint algorithm.
Merge test code into main shotwell code.
Fix case where ldexp(1.0, 16) == 0x10000; remove excessive asserts.