mds/CDir.cc: fix possible dereference after NULL check

CID 1019553 Dereference after null check (FORWARD_NULL, CWE-476)

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>