core: events: correctly handle POLLNVAL in gpiod_line_event_wait()
The only error that can be indicated by ppoll() in the revents field
of struct pollfd when polling a line events file descriptor is
POLLNVAL. It can happen if the user calls close() on said descriptor
after retrieving it with gpiod_line_event_get_fd().
Currently we would act as if there's a line event to read. Make
gpiod_line_event_wait() and its bulk variant return -1 and set errno
to EINVAL in this case.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>