Skip and warn on non-git directories

Otherwise the tool just stalls with:

```
(lese Log-Nachricht von Standard-Eingabe)

```

Change-Id: Ibbcbfa81fd9c46bdc692405acbac763e070eb5e4
diff --git a/bin/count_commits b/bin/count_commits
index d765c71..251fe0a 100755
--- a/bin/count_commits
+++ b/bin/count_commits
@@ -82,6 +82,11 @@
   my $dir = path($_);
   my $dir_str = $dir->to_string;
   if (-d $dir_str) {
+    my $git_dir = path($dir_str, '.git')->to_string;
+    unless (-d $git_dir || -f $git_dir) {
+      warn "$dir is not a git repository\n";
+      next;
+    };
     chdir $dir_str;
     my $out = `$cmd`;
     if ($out =~ /\s+(\d+)\s+$user/) {