Wales flanker Dan Lydiate says he thought they had nicked it at the end of a sensational opening Test against South Africa.