added better error handling to ldap_sync_check