Two-loop planar corrections to heavy-quark pair production in the quark-antiquark channel