Fixed|libcommon|Doom|Doom64: Build errors

Fixed a number of cases of illegal const usage and references to
temporary values.

It is sad that MSVC allows these to compile.