Fix error code checking for Windows build scripts (#57331)
Summary:
The variable `%errorlevel%` is evaluated before the whole line of command starts, so it is useless when used in a if-block. Also, let's prevent using `%errorlevel%` because it may be set by the users accidentally.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/57331
Reviewed By: anjali411
Differential Revision: D28140182
Pulled By: malfet
fbshipit-source-id: a3f21d65623bb25f039805c175e9f3b468bcb548