filedownloadutils: format detection improvement

* Updates the way external file format detection is happening, by
  trying to compare file extensions detected from downloaded file
  with expected MIME-type or extension.

* Improves the error message when formats are different.

Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>
BibUpload: use filedownloadutils with FFT

* Changes to use the filedownloadutils.download_url() function instead
  of bibdocfile.download_url() in order to benefit from (1) timeout
  and retry mechanics, and (2) improved format detection.

* BibUpload will now abort the FFT update should the format received
  from the given URL be different than the docformat expected.

Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>
BibDocFile: file_strip_ext improvements

* Improves the bibdocfile.file_strip_ext() function to work with
  cases where the same extension is doubled, for example if the
  URL would be "foo.pdf.pdf" now only the first ".pdf" is stripped.

* Adds a new file with BibDocFile unit tests and implements tests
  for file_strip_ext.

Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>