mds/Locker: fix null deref on cap import

The session Connection* may be NULL.

Fixes: #7708 Signed-off-by: Sage Weil <sage@inktank.com>