ALSA: fix locking in snd_pcm_open*() and snd_rawmidi_open*()