open: make a guess on application/octet-stream

Sometimes 'find' does not properly detect the file type and just returns
application/octet-stream. In such a case, we make a second attempt by
looking at the file name extension, before giving up.