Improve exit status calculation in the ipc_rm.