Hold the device lock with PulseAudio between mixing and writing