Add support for changing leader during testing.
Fix bug with etcd-master protocol.