Use libgit2 with threads

I compiled libgit2 with thread support and got no crashes so far. I think it could be the time to enable in in our releases.
I extensively looked at the log entries of TortoiseSVN and their do it the same way as we're doing it right now (for several reasons, e.g. race conditions).