**Describe the bug**
Clickhouse fails to log users after changing groups at LDAP for one user

**Does it reproduce on recent release?**
I've checked It on 21.2.5.5 and 21.3.4.25

**How to reproduce**
E.g. there is LDAP user *user_1* and there are two LDAP groups *role_1* and *role_2*, which are mapped to the Clickhouse roles with the same names. 
At the beginning *user_1* is only at *role_1* group
1. Log *user_1* in by clickhouse-client and check grants:
```
SHOW GRANTS

┌─GRANTS─────────────────────────────────────────┐
│ GRANT role1 TO user_1 │
└────────────────────────────────────────────────┘
```
2. Exclude *user_1* from *role_1* and assign him to the *role_2* group
3.  Try to log him in by clickhouse-client again. Login process  hangs forever. Also other users can't log in too.

**Expected behavior**
User will have updated grants after the re-login

**Error message and/or stacktrace**
I found no logs for that :(

**Additional context**
Clickhouse on CentOS, freeipa as a LDAP

UUID insertImpl(const AccessEntityPtr & entity, bool replace_if_exists) override;
    void removeImpl(const UUID & id) override;
    void updateImpl(const UUID & id, const UpdateFunc & update_func) override;
    ext::scope_guard subscribeForChangesImpl(const UUID & id, const OnChangedHandler & handler) const override;
    ext::scope_guard subscribeForChangesImpl(EntityType type, const OnChangedHandler & handler) const override;
    bool hasSubscriptionImpl(const UUID & id) const override;
    bool hasSubscriptionImpl(EntityType type) const override;
    struct Entry
    {
        UUID id;
        AccessEntityPtr entity;
        mutable std::list<OnChangedHandler> handlers_by_id;
    };
    void insertNoLock(const UUID & id, const AccessEntityPtr & entity, bool replace_if_exists, Notifications & notifications);
    void removeNoLock(const UUID & id, Notifications & notifications);
    void updateNoLock(const UUID & id, const UpdateFunc & update_func, Notifications & notifications);
    void setAllNoLock(const std::vector<std::pair<UUID, AccessEntityPtr>> & all_entities, Notifications & notifications);
    void prepareNotifications(const Entry & entry, bool remove, Notifications & notifications) const;
    mutable std::mutex mutex;
    std::unordered_map<UUID, Entry> entries_by_id; 
    std::unordered_map<String, Entry *> entries_by_name_and_type[static_cast<size_t>(EntityType::MAX)];
    mutable std::list<OnChangedHandler> handlers_by_type[static_cast<size_t>(EntityType::MAX)];
};
}