ipc: fix missing mutex unlocks on failed send