Mohammed Shami took a five-wicket haul in the final day as India secured a comprehensive 203-run victory over South Africa in the first Test.