Curl error: Network file descriptor is not connected