ldap: rename variables to comply to curl standards
ldap: check Curl_client_write() return codes

There might be one or two memory leaks left in the error paths.