Next-to-next-to-leading soft-gluon corrections for the top quark cross section and transverse momentum distribution