IN and OUT (pipe->sock) are now events, not callbacks

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>