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>
Merge pull request #651 from fernandogrd/master

DictWithMetadata.__getstate__ was never called (Fix for 645)