Search for top-squark pairs decaying into Higgs or Z bosons in pp collisions at root s=8 TeV