Fix compile warnings printing size_t

Original fix in 8b9566bd was enough to suppress the warning when
building the 32bit version of the Windows agent but the 64bit builds
still complain. An extra layer of encapsulation was required.
Merge pull request #360 from awiddersheim/fix_win32_warning

Fix compile warnings printing size_t
[logcollector] fix compiler warnings
[logcollector] fix clang analyzer warning: Null pointer passed as an argument to a 'nonnull' parameter
[logcollector] remove duplicated statement
[logcollector] fix CID 28448
[logcollector] fix CID 28447
[logcollector] fix CID 28519
remove strange code, relating to logcollector