Make sure that require() uses hasattr

It currently uses the effective but non-stdlib `field not in
self.__dict__`.