Improve fingerprinting of documents

Fixes two issues:
- #4456 : The first 100 bytes are often not unique as they can be
filled with standard PDF headers - so we use the first 200 KB instead.
(This may be overkill)
- Some documents we encountered have invalid xref ids, which were
always coming out as ‘0000000000000000’ - so we detect that and use the
MD5 instead.

Note: This does change the fingerprint for all previous documents, so settings etc would be lost. Maybe they should be migrated or is that acceptable?
could you also fix a bug when single digit number is converted to hex?

  var hex = hash[i].toString(16);
  fileID += hex.length === 1 ? '0' + hex : hex;