Two-Loop Helicity Amplitudes for Gluon-Gluon Scattering in QCD and Supersymmetric Yang-Mills Theory