use inttypes.h macros to determine printf format symbols if possible

This addresses a recent regression where different versions of
MinGW(-w64) had different opinions about whether to use e.g. %I64d or
%lld to print 64-bit integers on 32-bit platforms.