Fix EZP-20289 Symfony CSRF protection not integrated with legacy

This is the Symfony side of things injecting csrf settings if csrf is enabled
into api added in https://github.com/ezsystems/ezpublish/pull/552
CS: if conditions over several lines
Merge pull request #211 from ezsystems/legacy_csrf_inject

Fix EZP-20289 Symfony CSRF protection not integrated with legacy