namei: Fix use after free in kern_path_locked