EZP-22152: Fixed debug of legacy templates list when not in pure web context

When not in *pure web context* (e.g. tree menu), the legacy kernel uses a different kernel handler, which may not support `runCallback()`.