Fix dumpers/loaders after __slots__ cleanup
Commit 154b958 changed (correctly) the __slots__ usage, but this broke
dumpers/loaders since we relied directly on the own class __slots__
field.
To compensate, we introduce a simple function for computing the slots
across all parent classes (if any), and use this instead of __slots__
directly.
Note: the _all_slots() function is duplicated between objects.py and
opcodes.py, but the only other options is to introduce a lang.py for
such very basic language items.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>