fix a bug in which Curl::write failed to pass on its parent's return value