add container_of() macro

Signed-off-by: Alejandro Mery <amery@geeks.cl>
libev: clean cast abuse

Signed-off-by: Alejandro Mery <amery@geeks.cl>