The singular behavior of massive QCD amplitudes