restore the r/o DB access semantics in LDAP auth

The commit "70057f4 remember last successful LDAP server" broke the
semantics that DB write attempts did not occure when
$LDAP_options['cache_expiry'] was 0.

It is possible to set-up mysql replication and use RT in read-only mode
on a slave server with LDAP authentication, but LDAP caching must be turned
off.

This commit makes authenticated_via_ldap(), queryLDAPServer() funcs
to check the cache_expiry LDAP option before writing to the DB. Thus,
the "last successful LDAP server" does not work any more when LDAP caching
is disabled.