Virender Sehwag missed a world record third triple-century by seven runs as Sri Lanka hit back on the third morning of the final Test against India.