Add RewriteHistoryOptions.OnSucceeding and OnError

OnSucceeding is a chance to inspect rewritten commits/refs:
if it doesn't look right, throw to trigger a rollback.

OnError is a chance to inspect rewritten commits/refs before
rollback occurs, to see what went well and what didn't.
Fix UpdateLibgit2ToSha.ps1 path context handling
Garbage collection protection
Update libgit2 binaries to e87d9d3

https://github.com/libgit2/libgit2/compare/711333e...e87d9d3
Align IRepository with public Repository members
Favor IRepository usage over Repository
Drop unused parameter
Deprecated ResetOptions in favor ResetMode.
Add TreeDefinition.Add(string, TreeEntry)
fixup! Add TreeDefinition.Add(string, TreeEntry)
Add rewrite test that injects existing TreeEntry