unix: eventpump refactoring, now supports select