provider/template: template_dir: don't crash if source dir nonexistent
provider/template: template_dir: don't crash if source dir nonexistent

When an error is passed, the FileInfo can be nil, which was previously
causing a crash on trying to evaluate f.IsDir(). By checking for an error
first we avoid this crash.

terraform-providers/terraform-provider-template,hashicorp/terraform-provider-template,terraform-providers/terraform-provider-template,btobolaski/terraform-provider-linode,hashicorp/terraform-provider-template,btobolaski/terraform-provider-linode,terraform-providers/terraform-provider-template,hashicorp/terraform-provider-template,btobolaski/terraform-provider-linode