Measurement of the top quark mass using proton-proton data at sqrt(s) = 7 and 8 TeV