tldap: avoid a use after free crash