Measurement of the differential cross section for top quark pair production in pp collisions at sqrt(s)=8 TeV