core: fix panic in TestContext2Apply_resourceDependsOnModuleDestroy
core: fix panic in TestContext2Apply_resourceDependsOnModuleDestroy

This panic is likely caused by a bug, since "ami" should always be set,
but we'll fix the panic first to allow the tests to run to completion.

hashicorp/terraform-plugin-sdk,hashicorp/terraform-plugin-sdk