Added a check for the json extension

Debian unstable compiled PHP without the json extension because of
a license issue with the JSON parser used by PHP.

See https://github.com/composer/composer/issues/2092