Make classtypes hold a weak_ptr to their CU
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/22726
Differential Revision: D16197608
Test Plan: Imported from OSS
Pulled By: suo
fbshipit-source-id: 22250d6f0d249f61f269afb4fe8e7d1af0be1205