backends: Add WaitEvent and PollEvent

Signed-off-by: Cyril Hrubis <metan@ucw.cz>
pywrap: backends: Make use of WaitEvent and PollEvent.

Signed-off-by: Cyril Hrubis <metan@ucw.cz>