mds: fix nested_anchors update during journal replay

check if the inode is anchored/unanchored before updating the inode

Fixes: #7530
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>