The Princess Royal has described the first memorial to recognise the sacrifices of black South Africans who died while First World War labourers as a reminder of a “sometimes difficult past”.