[tests][install-agent] json usage made optional to suit distros with Py2.4