sha1_file: support reading from a loose object of unknown type