When using GET and PUT/POST on the same URL over and over curl could get into a state where POSTFIELDS was set incorrectly. This caused a malformed request to be generated which resulted in errors from the API. Fixes #24