Fix json error handling for PHP <5.3.3

Ubuntu 10.04 LTS is still supported by Canonical until April 2015 and uses a PHP version based on 5.3.2 with security fixes.