US discounter Dollar General posted a "solid" performance during its second quarter, with both net profit and sales growing on the back of increased traffic in its stores.