sound: Fix crash when sound device set to NULL

This can occur during transitions.

Introduced in f0812644.
11 jobs for <span class="ref-name">sound-null-ouput-device</span> in 4 minutes and 28 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Build
passed #244849
build

00:02:15

 
  Test
passed #244851
asan

00:02:11

passed #244850
test

00:00:43

 
  Manual
manual #244856
allowed to fail manual
armv8
manual #244852
allowed to fail manual
flatpak
manual #244855
allowed to fail manual
msan
manual #244857
allowed to fail manual
ppc64le
manual #244853
allowed to fail manual
tsan
manual #244854
allowed to fail manual
ubsan
 
  Review
manual #244858
allowed to fail manual
review
manual #244859
allowed to fail manual
stop_review