Refactor terminator_EnumerateDeviceExtensionProperties
This refactor accomplishes 2 goals: Clean up the code, and speed it up greatly.
The previous code intermingled two distinct code paths into one, making the logic of the
function extremely difficult to tease out. The logic to handle querying the device
extensions of layers has always been in its own if block, but the logic to handle when the
app queries for the pPropertiesCount and the logic to fill out pProperties were intermingled.
The difficulty of terminator_EnumerateDeviceExtensionProperties is that it has to make sure
to provide the exact count of extensions whenever there are active implicit layers which add
extensions to the overall list. This is because apps do not expect the first call to return
a number larger than the real count.
The speedup mainly comes two changes:
* Only extensions from layers are de-duplicated - assume the driver list is already free of
duplicates, as our search is a brute force linear search of all extensions in the list.
* Do not allocate memory when filling out pProperties - when the app calls this function the
second time, we do not need any extra memory to perform the logic required.