Closing procedures for IPC state machines formalised

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>