Dollar General Corp has agreed to be acquired by private equity fund Kohlberg Kravis Roberts & Co in a deal that could top $7.3bn.