d3d9trace: Improve D3D9 shader size computation.

Still not bullet proof, but better than before.
Only unbind dumpers when objects are truly released.
Retry creating D3D10/11 devices without debug flags.
Resolve some MS compiler warnings (in picky mode)

warning C4267: 'argument' : conversion from 'size_t' to 'DWORD', possible loss of data
warning C4244: 'return' : conversion from 'double' to 'int', possible loss of data
common: Add platform #ifdefs for non-cmake build convenience.

The cmake CMakeLists.txt file has logic for including or excluding certain
compilation units based on the platform: Windows, Linux or Mac OS X.
Other build systems are not as clever, it is convenient to also wrap
platform-specifics with #ifdef _WIN32 ... #endif to keep things simple on
the build side.
d3dretrace: Dump d3d10 PS resource shader views.
d3dretrace: Dump D3D11 textures too.