Add a timeout on the failedLatch which waits for the master to disappear

- removed the electedLatch since we can use cluster.await instead
Merge pull request #3092 from davidegrohmann/2.2-avoid-unboud-wait

Add a timeout on the failedLatch which waits for the master to disappear