sha1_file.c: split has_loose_object() into local and non-local counterparts