Fix an error when a test double was deserialized from YAML

The ivar @__unfrozen_attributes was properly serialized with YAML.

    "--- !ruby/object:RSpec::Mocks::Double\n__null_object: false\n__unfrozen_attributes: {}\nname: something\noptions:\n  :__declared_as: Double\n"

However the error was caused the invocation of #respond_to? in the
middle of the deserialization (i.e. before the ivar is restored).

This fixes #777.