DiffTop: a code for the calculation of the differential cross section for heavy-quark pair production at hadron colliders