gitdirstate: import errno for handling OSError

When handling OSError while visiting subdirectories, we're checking
errno, but we never imported this module. This small patch fixes this.
git_handler: don't bail on multiple octopus merges in succession

Consider two octopus merges, one of which is a child of the other. Without this
patch, get_git_parents() called on the second octopus merge checks that each p1
is neither in the middle of an octopus merge nor the end of it. Since the end
of the first octopus merge is a p1 of the second one, this asserts.

Change the sanity check to only make sure that p1 is not in the middle of an
octopus merge.