Fix some unit tests that are failing sometimes against replica sets.
Ensure that the heartbeat timer is only reprogrammed one time when an early heartbeat is requested.