PAL: Adding a new mutex for checking if stream is valid

The mActiveStreamMutex may be held by other thread and cost much
time which will affect performance like read/write API.
Adding a new mutex to protect and check if the stream is valid.

Change-Id: I1d065dbbd067557807c3281f92d45d319153962d
3 files changed