ipc: move locking out of ipcctl_pre_down_nolock