kernel/pipe: fix poll support

Two issues:

- is_condition_met() was missing proper code for The
  K_POLL_TYPE_PIPE_DATA_AVAILABLE case

- z_handle_obj_poll_events() was misplaced in z_impl_k_pipe_write()

Note: I added support for the deprecated pipe implementation to
      is_condition_met() but that is untested.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2 files changed