Fixes errno value for opens without O_CREATE

Return the error value of the path lookup, which could be due to a missing
directory, too many loops, etc.