Add non-context manager usage support for profiler (#61690)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/60238, https://github.com/pytorch/kineto/issues/329
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61690
Reviewed By: malfet
Differential Revision: D30016561
Pulled By: ngimel
fbshipit-source-id: 93a578ffbb556f4b584213ac9cfafcc5cf0a9270