odb: ignore files in the objects dir

We assume that everything under GIT_DIR/objects/ is a directory. This is
not necessarily the case if some process left a stray file in there.

Check beforehand if we do have a directory and ignore the entry
otherwise.
Merge pull request #2324 from libgit2/cmn/file-in-objects-dir

odb: ignore files in the objects dir