Invert ownership between PyFunction and THPFunction.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/22983
Test Plan: Imported from OSS
Differential Revision: D16422209
Pulled By: ezyang
fbshipit-source-id: d6e41a1606484fbbd7a95a547b83a4199151be68