py: Add base class LibraryWrapper

LibraryWrapper will be a base class for others wrapping a shared
library with ctypes.

And add various functions (i.e. expect_ge_zero()), which will be used as
callback functions to check the return value of an API call.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Daniel Martin <consume.noise@gmail.com>

Squashed: py: Add ENCODING="iso8859-1" to const.py
The ENCODING is used to decode bytes to str objects

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
py: Add and use wrapper for libc calls

Introduce a class LibC in base.py, which wraps fdopen and fflush, and
replace _call0()s to fdopen and fflush in __init__.py.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
py: Add and use wrapper for libevemu calls

Introduce a class LibEvemu in base.py, which wraps API calls to
libevemu, and replace _call()s by using it.
As this obsoletes the class EvEmuBase, it's removed as well.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>