this needs to check the handle type before calling uv_is_writable (just reorder the if statement conditions)