Proteas edge past Afghans in double Super Over thriller