ITS#8997 - Fix segfault by setting return code value

Fix case with back-ldap where an entry was returned but didn't match the filter being applied by setting the return code value before dropping to cleanup.
