mds: fixes for coverity scan

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Merge pull request #973 from ceph/wip-mds-coverity2

mds: fixes for coverity scan

Reviewed-by: Sage Weil <sage@inktank.com>