[PATCH v2 19/22] rpc: fix shutdown sequence when preserving state