This should help us diagnose issues with ldap_result() returning -1.
The only catch is that it relies on the openldap libraries setting the
error code properly, which they do not always do.*
* As part of my tests, I reverted the openldap libraries to the 2.4.29
release that was broken with SSSD, causing ldap_result to return -1 all
the time. The LDAP_OPT_RESULT_CODE in that case was LDAP_SUCCESS.