omit unnecessary #include
lock OS thread when MakeGitError might be called
free C string