s3:pdb_ldap: optimize ldapsam_alias_memberships() and cache ldap searches.
ldapsam_alias_memberships() does the same LDAP search twice, triggered
via add_aliases() from create_local_nt_token().
This happens when no domain aliases are used.
metze
(cherry picked from commit
49ace81e19de231825216cbf07c7422687131bb6)
(cherry picked from commit
cb31c1df92b195b3fb80b6e21bfba83b8cd867fd)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
8f1c7c117b3bca058024daa34f777efa5ece88f8)