core: avoid unnecessary ctime() calls when debugging is disabled, increase performance (Opsview Team)

interesting. now the straces make more sense, and the ctime() calls are
hidden below a check if debugging should actually happening, being
avoided in productive environments.

not that i would expect huge performance increasement, but some cpu
cycle savings of course.

fixes #4681