problem: elections are not started when peers join on enter and when leader exits (#676)
problem: elections are not started when peers join on enter and when leader exits (#676)

* problem: elections are not started when peers join on enter and when leader exits

solution:
- start elections for groups that are joined before peer starts and for which elections are declared
- when peer exists, check if it is leader and if yes, restart elections

Co-authored-by: Stéphane Valès <e137e5861fdbef5683da4cb7816bc58157f26b62@users.noreply.github.com>
Co-authored-by: stephane vales <3feb95057c565332611662af070bd96dd64f311d@ingenuity.io>
zeromq/zyre,zeromq/zyre,zeromq/zyre,zeromq/zyre,zeromq/zyre,zeromq/zyre,zeromq/zyre,zeromq/zyre