[PATCH v6.1] smb: prevent use-after-free due to open_cached_dir error paths