Use the new implementation of `six.with_metaclass`.

No more `NewBase` horrors.

Thanks to bendavis78 for his work on merging this into six.
Fixed #22447 -- Make sure custom model bases can be migrated.

Thanks to cdestigter for the report.