Do not fail if .gitignore is directory

This is designed to fix libgit2/libgit2sharp#350 where if `.gitignore` is a directory we abort all operations that process ignores instead of just skipping it as core git does. The same issue applies if `.gitattributes` is a directory as well.

Also added test that fails without this change and passes with it.