Fixed EZP-20698 - When including a legacy template in a twig template, fetch functions don't work

Using `chdir()` to go back in the right directory (legacy root dir) after converting API objects to legacy objects.
This is necessary since `LegacyKernel::runCallback()` brings back to Symfony web directory.