Fix some of the template syntax error checks

We need to initialise GError *error to NULL, otherwise random junk may
break the assertions. This patch does just that.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>