Strip newline when ingesting `version.txt` (#36002)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/36002
Test Plan: Run cmake and observe there are no warning in stdout nor in `CMakeCache.txt`
Differential Revision: D20872854
Pulled By: malfet
fbshipit-source-id: 8a61b63b3d564e597e7a62dd913c97bc64b183b9