Fix master detection corner case

Make sure that if a non-leading master appears or disappears, the
framework does not disconnect and reconnect.