Close each LDAP connection after it is used,
following python-ldap docs

Fixes bug 1172164

Change-Id: If20e3c1cf3deac5ce4217ce0324f8c91c2e30f92