Fix: memory/fd leak when cleaning streams in channel

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: cleanup relayd on any I/O error in read subbuffer mmap

Any I/O operation that triggers an error now cleans the relayd since
there is no way we can recover from that in any cases and streams
associated to that relayd need to be cleaned up.

This commit also removes the "written" variable that is simply not
needed and was a bit confusing as a returned value.

Signed-off-by: David Goulet <dgoulet@efficios.com>
Fix: write index only if fd is valid

Signed-off-by: David Goulet <dgoulet@efficios.com>