CRAS: iodev_list - Check if pinned device is open already

cras_iodev can be opened and accessed by audio_thread
in two ways:
(1) UI enables an input/output audio node.
(2) An application creates a stream that pins to specific audio node.

This change adds a function to ask if the given device is already
in use by the audio_thread. It can be used to avoid unecessary
calls and possible multi thread access to iodev.

BUG=chromium:890242, chromium:863823
TEST=unittest

Change-Id: I24713e15f1039599abd3387fbc1bbe2c490efff1
Reviewed-on: https://chromium-review.googlesource.com/1257487
Commit-Ready: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
4 files changed