Use libgit2 for checking for orphaned HEAD

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Fixed issue #1646: TortoiseGit Log gives undeterministic results (log does not apply --boundary any more by default)

Signed-off-by: Sven Strickroth <email@cs-ware.de>