Test git in dep folder to consider checked out

If the .git folder of a dep becomes corrupted, any git command
issued by mix could find a parent .git folder and wipe the parent
tree.

This fix only consider a git dependency checked out if git is able
to read the .git folder.