Fix dup tests to not free in-use semaphores/fences
The dup{,2,3} tests were subject to a race condition in which a
semaphore may be deleted before a VkQueue which was dependent on it had
completed execution.
This change moves the vkQueueWaitIdle call into the same scope as the
semaphores/fences that the queue is dependent on.
VK-GL-CTS issue: 1538
Components: Vulkan
Affects: dEQP-VK.api.external.{fence,semaphore}.opaque_fd.dup*
Change-Id: I73cf541c9c184790df44b68b8a065787634847d9
(cherry picked from commit
732a8b6800972b271735cf9b865a3612fb56dfc4)