d3d12: Fix more GCC and clang warnings
The main goal here is to get the d3d12 driver (and supporting libs) to be GCC warnings-clean so we can enable Linux CI for them.
The first several commits get us to GCC warnings-clean, including two which definitely fix real (minor) bugs. After that is a series of commits for clang warnings, including at least one real bugfix (you could convince me some more of them are real bugfixes too though). We're not clang warnings-clean due to including a C header which uses {0}
in C++ code, not to mention the warnings detected from the rest of the codebase.