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.

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
Consider only valid .git repos as checked out