Stop the heartbeat thread.