mds/MDCache.cc: fix possible NULL pointer dereference

Assert if 'cur' is NULL.

CID 966616 (#1 of 1): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "cur" when
  calling "CInode::is_dir()".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/MDS.cc: fix dereference null return value

Fix for:

returned_null: Function "SessionMap::get_session(entity_name_t)" returns
  null (checked 12 out of 14 times)

CID 739601 (#1 of 1): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null
  "this->sessionmap.get_session(entity_name_t::CLIENT(client.v))" when
  calling "MDS::send_message_client_counted(Message *, Session *)"

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rbd.cc: silence CID COPY_PASTE_ERROR warning

CID 1021212 (#1 of 1): Copy-paste error (COPY_PASTE_ERROR)
  copy_paste_error: "r" in "r = -*__errno_location()" looks like
  a copy-paste error. Should it say "fd" instead?

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
mds/Server.cc: fix possible NULL pointer dereference

Add asserts to solve these CID issues:

CID 717002 (#1 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "dir"
  when calling "CDir::lookup(std::string const &, snapid_t)".
CID 717002 (#2 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "dir"
  when calling "CDir::lookup(std::string const &, snapid_t)".

CID 717003 (#1 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "dn" when
  calling "operator <<(std::ostream &, CDentry &)"
CID 717003 (#2 of 2): Dereference null return value (NULL_RETURNS)
  dereference: Dereferencing a pointer that might be null "straydn"
  when calling "CDentry::push_projected_linkage()".

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Merge pull request #309 from dalgaaf/wip-da-CID-fixes-3-v2

Reviewed-by: Sage Weil <sage@inktank.com>