use cross-platform sed command in cmake_configure_file (#73589)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73589
Long-form flags do not work and neither does the \w character class.
Test Plan: Imported from OSS
Reviewed By: malfet
Differential Revision: D34558345
Pulled By: dagitses
fbshipit-source-id: 73e1b18bdd55d67fd3936428400c3835684549b0
(cherry picked from commit fc85796fadb8dac0043ba0bf43fd54cf817665b7)