[ALSA] Fix possible invalid memory access in PCM core