display-test: test if threads are woken up on EAGAIN

When wl_connection_read() in wl_display_read_events() returns with EAGAIN,
we want the sleeping threads to be woken up. Test it!

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
client: wake-up threads on all return paths from read_events

If wl_connection_read returned EAGAIN, we must wake up sleeping
threads. If we don't do this and the thread calling
wl_connection_read won't call wl_display_read_events again,
the sleeping threads will sleep indefinitely.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
client: cancel read in wl_display_read_events() when last_error is set

Calling wl_display_read_events() after an error should be equivalent
to wl_display_cancel_read(), so that display state is consistent.

Thanks to Pekka Paalanen <pekka.paalanen@collabora.co.uk>
for pointing that out.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
shm: fix error in comment