layers: MR181/GL102 Fix unique_objects to correctly assign local vars under ptrs
layers: MR181/GL102 Fix unique_objects to correctly assign local vars under ptrs

If a variable that needs to be restored is below a ptr, then need to declare
it at the top level, but only assign it if the ptr(s) that it's below are
non-null.

KhronosGroup/Vulkan-Tools,KhronosGroup/Vulkan-Tools,KhronosGroup/Vulkan-Tools,KhronosGroup/Vulkan-Tools