make sure cursor doesn't point to freed memory on failure. From: Wynn Wilkes <wwilkes@vintela.com> git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15164 ec53bebd-3082-4978-b11e-865c3cabbd6b