json: json-c 0.12+ compatibility

In order to be able to build with both json-c 0.9 and 0.12+, we need
some compatibility shims, to replace deprecated functions. This patch
adds just that, surrounded with appropriate ifdefs. Based on a patch by
Balazs Scheidler <bazsi@balabit.hu>; see #153 for details.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Merge branch 'h/json-c-0.12' into 3.5/master