audio policy: fix HAL stream activity ref counting

commit f05fc906 did not take into account the specificities of duplicated
outputs causing a crash when accessing the profile (null for duplicated outputs)
and not counting activity resulting from duplicated output activity.
Also account for HW source activity when connected to an output mix.

Bug: 70319466
Test: CTS tests for AudioTrack and AudioRecord
Test: audio smoke tests

Change-Id: Id0364170794302e42212a90e1b40e28c1e7193fe
5 files changed