Fix connection fail

Wrap the functions that go the the LDAP server in a TryOrFail decorator and have them retry up to three times in case a failure in the LDAP connection occurs, with a timeout of 10s.