[Twig] fixed TwigEngine::exists() method when a template contains a syntax error (closes #88546)