How to properly test whether an asynchronous ldap_connect() has fully connected?