Make use o issubclass instead of isinstance (fix issue #645)

Because __mro__ is a list of classes and not instances.
DictWithMetadata.__getstate__ was never called

Signed-off-by: Fernando Rocha <fernandogrd@gmail.com>