hammer - Fix exit path for newly added ioctl

* Release cursor/inode on exit.
* Take in account the case where hammer_get_inode() returns a NULL ip.