Fix crashes with foreign serializers

Foreign serializers like msgpack and igbinary may crash on randomly initialized zval because they check of IS_ARRAY, IS_OBJECT (or any type) on certain circumstances.