core: fix printf format casts for struct timeval fields
Explicitly cast struct timeval fields to long when passing them to printf-style functions.
This avoids compiler warnings/errors on platforms where tv_sec or tv_usec are not exactly of type long, while keeping the existing log and control output unchanged.