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

- add a timeout on the failedLatch which waits for the master to disappear
- removed the electedLatch since we can use cluster.await instead