[PATCH 6.6 543/676] smb: prevent use-after-free due to open_cached_dir error paths