client: fix potentiall invalid read in trim_caps

trim_dentry can potentially free an inode, so get/put
it around the look where we use the inode's dn_set.

Signed-off-by: John Spray <john.spray@redhat.com>