Fix EZP-23332: Templating Legacy Engine throws warning if TemplateRefere...

...nce is passed as param to supports method

Fixes https://jira.ez.no/browse/EZP-23332

Found this issue when trying to add a translation webinterface to my project
http://jmsyst.com/bundles/JMSTranslationBundle/master/webinterface
Following all the steps there and pointing your browser to [your_dev]/_trans, we have a warning saying

```
ContextErrorException: Warning: Illegal offset type in isset or empty in [...]/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Legacy/Templating/LegacyEngine.php line 136
```



To me, the real fix is simply:

    $name = (string) $name;

Independently of $name being a `Symfony\Component\Templating\TemplateReference`.

It is true that method `__toString()` of `Symfony\Component\Templating\TemplateReference` actually calls `getLogicalName()`, but this is `TemplateReference`'s own business and it wouldn't be true anymore if `__toString()` would be modified or decorated.