bibdocfile: improvements of URL handling methods
- When guessing the format of a file, perform a HEAD request.
- When downloading a file, use only one socket to get the format and download the file.
- New download_local_file() and download_external_url() functions. (closes #252)