libgit2/libgit2 — pull request #1890 by ben (2013-10-03 20:09:56+00:00)
Title: Multiple init

As discovered in https://github.com/libgit2/libgit2sharp/pull/517, initializing the threadsafe mechanisms multiple times doesn't seem to have any ill effects, but bad things would start to happen after the first call to `git_threads_shutdown`.

This PR converts the status variables to be something like a reference count, and the global threading primitives are only freed once the counter reaches zero.