Wales head coach Warren Gatland says South Africa deserved to win their Rugby World Cup semi-final but is proud of how his side battled.