Introduce JsonSerializable polyfill and support in Zend\Json\Encoder

This is an alternative to https://github.com/zendframework/zf2/pull/4507

It introduces a polyfill into `Zend\Stdlib` which can be used by legacy PHP implementations. `Zend\Json\Encoder` then tests for the PHP built-in interface which will work even on PHP implementations where `\JsonSerializable` doesn't exist.