Avoid forming deadlock when steam drains upon device switching (#528)
Avoid forming deadlock when steam drains upon device switching (#528)

This solves the deadlock mentioned in BMO 1572273 comment 6. It's very
likely to have a deadlock when the output callback tries to stop the
input AudioUnit when the input device is unplugged while the output
device is unchanged during a WebRTC call.

One of the thread forming the deadlock is internal so we don't have any
control on it. The only way to free the deadlock is to prevent the
output callback to require the CAMutex tied to the input AudioUnit.

With the change, the input AudioUnit will be stopped in its own callback
so the deadlock won't be formed.
kinetiknz/cubeb,kinetiknz/cubeb,kinetiknz/cubeb