bibdocfile: guess_format_from_url() improvements
- guess_format_from_url() is now always returning an extension (when the format is unknown it will return '.bin').
- guess_format_from_url() will return '.txt' extension for simple text files when recognized by the magic library.
- guess_format_from_url() always consider any extension existing in the filename when provided with a local path (.e.g /tmp/example.foo) will return '.foo' is a not recognized extension.
- Refactored the code using the magic library.
- If downloading a remote URL is necessary in order to guess the extension, always delete the temporary file at the end.