Adapt to pyuv API changes

Should fix #1232