curl: Add support to return the response code