BibDocFile: support new magic library

* There are two flavours of the magic library (for file
  format guessing): the original bindings coming with the
  CLI file utilities, and the new python-magic bindings
  wrapping libmagic using ctypes. Support for the new
  library is here introduced (while still allowing for
  the old one).  (closes #1207)

Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
Merge branch 'maint-1.0' into maint-1.1

* maint-1.0:
  BibDocFile: support new magic library
Merge branch 'maint-1.1'

* maint-1.1:
  BibDocFile: support new magic library

Conflicts:
	modules/bibdocfile/lib/bibdocfile.py
Merge branch 'master' into next

* master:
  BibDocFile: support new magic library