Uses code from Celluloid::IO PR#87

Depends on celluloid/celluloid-io#87