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.