Soft gluon corrections to large-pT direct photon and dilepton production