Connections between spin-orbit torques and unidirectional magnetoresistance in ferromagnetic-metal–heavy-metal heterostructures