Measurement of top quark-antiquark pair production in association with a W or Z boson in pp collisions at $\sqrts = 8$ $\,\text TeV$