shared-mem-locks: fix shutdown crash