Fixing issue with PUT requests resetting the curl state