Measurement of longitudinal flow decorrelations in Pb plus Pb collisions at root s(NN)=2.76 and 5.02 TeV with the ATLAS detector