CoreAudio: take ownership of disconnect listener blocks
DeviceDisconnectMonitor stored the HAL listener block in a
shared_ptr without retaining it, relying on ARC lifetime
semantics in a file compiled without ARC. Once the
autorelease pool drained, only CoreAudio held the block, so
the first removal freed it and any later removal passed a
dangling pointer to AudioObjectRemovePropertyListenerBlock.
Copy the block with Block_copy on registration and release
it in the deleter, skip removal when the device is no longer
alive, and retire each registration at most once by tracking
it in m_state.
Pick-to: 6.12
Fixes: QTBUG-151116
Change-Id: Ib810c2357497ebe1a632db0801cfc9cf6c6cf771
Reviewed-by: Nils Petter Skålerud <nils.petter.skalerud@qt.io>