tests: move the logger initialization up in the templates
tests: move the logger initialization up in the templates

Removes a bunch of complaints that logger may be None and thus doesn't
have things like debug().

flatpak/xdg-desktop-portal,flatpak/xdg-desktop-portal,flatpak/xdg-desktop-portal,flatpak/xdg-desktop-portal