Fix buffer allocation/deallocation and localize curl databuffer