Pietersen’s South Africa campaign ends in defeat