Fix EZP-23071: duplicate jquery inclusions break jquery plugins

JIRA: https://jira.ez.no/browse/EZP-23071

This is an alternative to https://github.com/ezsystems/ezpublish-legacy/pull/1008
ezscript/ezcss_require functions do not create a unique list of files, which may break for example jquery plugins.

Handles legacy only, so problems may still exist due to assets included from twig.