audio VTS: Fix HAL device management

Straighten out logic in DeviceManager for proper handling
of IPrimaryDevice and IDevice instances across all supported
HAL versions.

This fixes a recently introduced bug which was causing
the same HAL device to be opened twice in a row, and then closed
twice.

Bug: 218610286
Test: atest VtsHalAudioV7_0TargetTest
Test: atest VtsHalAudioV7_1TargetTest
Change-Id: I415cbadae9d325ac63160e49e5e638906c8c63fd
(cherry picked from commit 285c0a041cb21bd72e4971702cd28fd2d1253e9a)
Merged-In: I415cbadae9d325ac63160e49e5e638906c8c63fd
2 files changed