Fix replacing of a directory with a file/symlink in git-checkout-cache
Fix replacing of a directory with a file/symlink in git-checkout-cache

The symlink case had never worked, and the file case was broken by the
O_EXCL change because the error return changed from EISDIR to EEXIST.

Fix both problems by just moving the test for an existing directory to a
more logical place.

destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git,destenson/git