State `debconf.set_file` now accepts a template as a file

It follows the same convention as `file.managed` for example.

This also introduces a new function in the `debconfmod` module to set the
Debconf selections from a template or, as before, from a simple file.

Fixes #7331
Fix undefined _error() function, thanks to Pylint
Merge pull request #18262 from multani/fix/debconf-set-file-template

State `debconf.set_file` now accepts a template as a file