Make sure to call git_threads_init upon program entry and git_threads_shutdown upon exit.
Reimplement opaque structs to work around Issue 10497.