N$^3$LO calculations for top-quark differential cross sections near partonic threshold