[sdb] Fix another shutdown crash. Fixes #25009.