lvmdbusd: fix deadlock on SIGINT in lvm shell mode
Fix race condition where signal handler could deadlock waiting for shell_lock while worker thread waits for cfg.run.value to be set.
The deadlock scenario:
- Worker thread T1 holds shell_lock, waiting in select() (0.5s timeout)
- Signal handler receives SIGINT, calls exit_shell()
- exit_shell() blocks trying to acquire shell_lock (held by T1)
- Signal handler never reaches cfg.run.value = 0 (blocked at step 3)
- T1 wakes from select(), checks cfg.run.value != 0 (still true!)
- T1 goes back to select(), repeating until test timeout
Solution: Set cfg.run.value = 0 BEFORE calling exit_shell(). This allows worker threads to detect shutdown even if the signal handler blocks on shell_lock, breaking the deadlock.
This fixes occasional test_z_sigint failures in lvm shell mode where the daemon fails to exit within 10 seconds after receiving SIGINT.
Co-Authored-By: Claude noreply@anthropic.com