Cleanup C example, fixing some potential bugs
- Remove magic numbers by using defines
- Use 10k buffer size for all downloaded data
- Better error handling
- strlen wasn't correct in many places where it was used; replaced with memcpy
- use new object when posting changes (fixes broken behavior causing seg faults)