mm-video-v4l2: vidc: Fix race condition with msg thread fd close

Post a close msg and wait for the thread to process that msg before
closing the fd. If we close the fd before, the same might get acquired
by someone else leading to a dead lock as the thread then will never
exit and will be stuck in read.

Change-Id: I3d3d36f90c4fc7d6c51d9900d5f93965c2277077
4 files changed