South African grocery retailer Massmart has posted a drop in first-half profits on the back of costs from the sale of a majority stake in the business to Wal-Mart Stores.