Add extern to some prototypes

Also define json prototypes ourselves. Otherwise, they are defined without
extern and have the side effect of defining variables, leading to multiple
definitions and compile errors if -fno-common is passed.

    NetworkManager/NetworkManager#329
17 jobs for master in 13 minutes and 35 seconds (queued for 2 seconds)
latest