Dollar Tree is selling Family Dollar after a decade of ownership, as it faces rising costs and shifting retail strategies.