Fix test for attribute HAVE_DECL_MPZ_POWM_SEC

Existing test raises AttributeError (and traceback) in absence of
attribute. Use hasattr(obj, attr) rather than wrapping in try-except
block, since this is a test and not a genuine attempt to use.