Handle exceptions from THPModule_setQEngine (#60073)
Summary:
Prevents Python runtime crashes when `torch._C._set_qengine(2**65)` or `torch.backends.quantized.engine="fbgemm"` if PyTorch was compiled without fbgemm
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60073
Reviewed By: supriyar
Differential Revision: D29156430
Pulled By: malfet
fbshipit-source-id: 95b97352a52a262f1634b72da64a0c950eaf2373