The singular behaviour of QCD amplitudes at two-loop order