Add Pickler C++ API (#23241)
Summary:
This PR adds functions to wrap the Pickler and exposes them to the C++ API
](https://our.intern.facebook.com/intern/diff/16675418/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/23241
Pulled By: driazati
Differential Revision: D16675418
fbshipit-source-id: 76543c81ac67c3e20a75ebc2073191bcbd6573bf