basic-funcs: Preserve escaping settings in conditional functions

In $(if) and $(grep), preserve the escaping setting of the parent in the
generated template too. This means that we have a ${MESSAGE} in one of
the conditions, and the parent has template_escape(no) set, then the
result of the conditional expression will not be escaped either.

References: bugzilla #30147
Signed-off-by: Gergely Nagy <algernon@balabit.hu>