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.
Merge pull request #1791 from libgit2/cmn/revwalk-recursive

revwalk: make mark_unintersting use a loop