Added some more paranoia to decode_value().

There was a potential NULL-deref when decoding destructed objects.