Fix freeing custom device in dynamic state tests
Some dynamic state tests use a custom device that was not being properly
freed when existing a test group that used the device. This sometimes
caused crashes on program termination.
No tests should be affected by this change. This fix only touches the
test hierarchy. However, to check the fix doesn't break anything:
dEQP-VK.dynamic_state.*
Components: Vulkan
VK-GL-CTS issue: 3602
Change-Id: I6bf97900497b6e795c1fbacef5b3fc68619a9ff4
(cherry picked from commit
33fba799401ba8e74907bf4bf7893d50f188e842)