[pytorch] fix (ProfiledType|TraceType)None.cpp (#39934)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39934
Shouldn't write .cpp file when it's called to produce header file.
Test Plan: Imported from OSS
Differential Revision: D22016596
Pulled By: ljk53
fbshipit-source-id: 30a1b4a527bc1ffd8ee748c70494fe712be60c4f