pickler read guard (#24433)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/24433
bounds checker was only used once per instruction. If a read in the
middle of an instruction went of the end of the stream, it would just
read invalid memory. This replaces bounds checker with just one
guarded read function.
Test Plan: Imported from OSS
Differential Revision: D16836178
Pulled By: zdevito
fbshipit-source-id: a7f70d0f293bf26c3220a12bafb8a06678931016