ALSA: pcm - fix race condition in wait_for_avail()