mm-audio: Avoid command thread loop if omx component is stopped

When omx init and deinit are called in short duration,there
is a possibility that deinit is called before command thread
is started. omx_thread_stop closes respective pipe and waits
for the command thread to exit.
In a specific scenario, same pipe fd is allocated in another
module and command thread in omx continues to read from the
same pipe although it is closed by the main omx thread.
omx_thread_stop is blocked infinitely due to this reason

Fix is to set a flag in omx_thread_stop to avoid command
thread to go into the read loop if it is started after
omx_thread_stop is called

Change-Id: I4b9c4909c7178010568219fddcd05eaafdddc769
4 files changed