mds/MDCache.cc: fix dereference after null check

CID 716921 (#1 of 1): Dereference after null check (FORWARD_NULL)
  var_deref_model: Passing null pointer "dir" to function
  "operator <<(std::ostream &, CDir &)", which dereferences it.

Add check for 'dir' before use it.

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