Issue #5766 - Check channel closed state in /events loop

When listener channel is closed, it becomes always available for reading: select becomes an active loop which writes default-constructed events (i.e: empty strings).

Sorry for the lack of test, but I have a hard time writing a unit test for `/events` (un-terminating API call)

Fixes #5766

Docker-DCO-1.1-Signed-off-by: Arnaud Porterie <arnaud.porterie@gmail.com> (github: icecrime)