Fix performance problem in lcas
Fix performance problem in lcas

`update_ancestors_marks` should stop exploring when it doesn't change a
node's mark.

This reduced the time to search for an LCA between 6fbc206 in the Docker
repository and a disconnected commit to 2s (previously it took so long I
aborted it).

mirage/irmin,mirage/irmin,samoht/irmin