Some Python 3 C-API fixes.

tp_getattr and tp_setattr are deprecated.
Use tp_getattro and tp_setattro instead.