[9.18] Fix a stack buffer overflow in the statistics channel
A long timestamp in an If-Modified-Since header could overflow a fixed-size buffer.
(cherry picked from commit b22c87ca)
Closes #4124 (closed)
Backport of !8195 (merged)
Edited by Ondřej Surý