More robust file extension handling in -l
More robust file extension handling in -l

Checks the destination page's content-type and checks in /usr/share/mime/globs the correct extension to use. If the file is not present, fallback to the old method.
`curl -sf --head` only downloads the header, which means the content doesn't actually get downloaded 2 times in a row.
jschx/uguush