Infrared factorization of tree-level QCD amplitudes at the next-to-next-to-leading order and beyond ☆