Add timeout handling to ldap_search