Clean up rustc warnings.

These are basically all straightforward changes and should not impact behavior of the language.
(I don't think it's necessarily a bad thing, just wondering if I missed the PR that made it a warning to have `cfg(target_os=...)`.)