Resolve C4267 MS compiler warnings

The C4267 isn't globally disabled by the apitrace CMakeLists.txt,
using explicit c-casting here to appease the MS compiler.

warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data