NNLO QCD corrections to jet production at hadron colliders from gluon scattering