UK retailer The Co-operative Group has struck a deal to buy Scottish convenience store firm David Sands.