iohandlers: port posix implementation to glib