Fix compilation of the json-c bits.
Fix linking of libcurl.
Upgrade protobuf from 2.4.1 to 2.5.0.