bpo-42143: Ensure PyFunction_NewWithQualName() can't fail after creating the func object (GH-22953) (GH-23021)

func_dealloc() does not handle partially-created objects. Best not to give it any.
(cherry picked from commit 350526105fa9b131d8b941ae753378b741dabb2f)

Co-authored-by: Yonatan Goldschmidt <yon.goldschmidt@gmail.com>
2 files changed