Fix some items identified as problematic by Wextra and other clean-up (#59909)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/59909
Test Plan: Sandcastle
Reviewed By: vkuzo
Differential Revision: D29073150
fbshipit-source-id: 500a92ccb57b0e40277863a3b235099fd66ab8ad