cdev: introduce client 'dead' state
Files have the disadvantage that the kernel (or in this case 'we') cannot
force a client to close it. Instead, we have to mark it as 'dead' and wait
until the client closes the file theirself.
While marked as 'dead' we always return EPIPE or signal EPOLLHUP so the
client will notice that the file is dead.
This fixes a bug where when we forced an unregistration of a cdev session,
the cdev_client went away too early and the user still had the file open.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>