Also handle ENOTDIR when canonicalizing paths