Chase down an executor lockup bug.
Fix master detection corner case

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