Fixed a couple Clang warnings

Fixed some recently introduced "regressions" that trigger Clang warnings while building on OS X (`checkout.c` one is a real bug too).
This would then cause us to (wrongly) fail as OOM, when the issue is that we don't have the right inputs. This looks like it should instead be `assert(ancestor || ours || theirs)` before the ifs.