[JENKINS-23012] Resolved a performance problem introduced in 1.13 by capturing log outputs.

[JENKINS-23012] (https://issues.jenkins-ci.org/browse/JENKINS-23012)

Capturing and forwarding log outputs to `BuildTimeOutStrategy` introduced in 2129c5d8fc4a9d9432cf95ce34ce522e646eb3ff causes a performance problem.
Changed to capture only when `BuildTimeOutStrategy#onWrite` is overridden.