[c10d] Reorder macros so they are defined before getting used (#85850)
Summary: Move preprocessor macros all the way up, so they are defined before being used.
Test Plan: existing tests
Reviewed By: wanchaol
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85850
Approved by: https://github.com/wanchaol