Measurement of the triple-differential dijet cross section in proton-proton collisions at sqrt(s) = 8 TeV and constraints on parton distribution functions