Barclays reports first-half loss on Africa unit sale