revwalk: make mark_unintersting use a loop

Using a recursive function can blow the stack when dealing with long
histories. Use a loop instead to limit the call chain depth.

This fixes #1223.

---

Repeating the vector pop seems a bit icky, but I'm not sure how to refactor it other than setting `i` to `commit->out_degree` so we skip the loop, which also seems a bit icky.