loader: Rename icd and physical device vars

Clean up the names of the icd and physical device structs, lists, and
variables used throughout the loader.  Before, it was hard to tell where
the item was to be used appropriately.  Now, the names include a hint as
to where they are expected to be allocated, freed, and used.

Also, fixed a bug where we were using a trampoline item in a terminator
function, which caused issues.  Thanks to Piers @ Nvidia for discovering
this.

Change-Id: If98628a5496e9f645eff94b73e80ae7f8408f7b4
diff --git a/loader/extensions.c b/loader/extensions.c
index 40dd297..9b59eb5 100644
--- a/loader/extensions.c
+++ b/loader/extensions.c
@@ -51,16 +51,16 @@
     VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags,
     VkExternalMemoryHandleTypeFlagsNV externalHandleType,
     VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) {
-    struct loader_physical_device *phys_dev =
-        (struct loader_physical_device *)physicalDevice;
-    struct loader_icd *icd = phys_dev->this_icd;
+    struct loader_physical_device_term *phys_dev_term =
+        (struct loader_physical_device_term *)physicalDevice;
+    struct loader_icd_term *icd_term = phys_dev_term->this_icd_term;
 
-    if (!icd->GetPhysicalDeviceExternalImageFormatPropertiesNV) {
+    if (!icd_term->GetPhysicalDeviceExternalImageFormatPropertiesNV) {
         if (externalHandleType) {
             return VK_ERROR_FORMAT_NOT_SUPPORTED;
         }
 
-        if (!icd->GetPhysicalDeviceImageFormatProperties) {
+        if (!icd_term->GetPhysicalDeviceImageFormatProperties) {
             return VK_ERROR_INITIALIZATION_FAILED;
         }
 
@@ -68,13 +68,13 @@
         pExternalImageFormatProperties->exportFromImportedHandleTypes = 0;
         pExternalImageFormatProperties->compatibleHandleTypes = 0;
 
-        return icd->GetPhysicalDeviceImageFormatProperties(
-            phys_dev->phys_dev, format, type, tiling, usage, flags,
+        return icd_term->GetPhysicalDeviceImageFormatProperties(
+            phys_dev_term->phys_dev, format, type, tiling, usage, flags,
             &pExternalImageFormatProperties->imageFormatProperties);
     }
 
-    return icd->GetPhysicalDeviceExternalImageFormatPropertiesNV(
-        phys_dev->phys_dev, format, type, tiling, usage, flags,
+    return icd_term->GetPhysicalDeviceExternalImageFormatPropertiesNV(
+        phys_dev_term->phys_dev, format, type, tiling, usage, flags,
         externalHandleType, pExternalImageFormatProperties);
 }