Fix stack corruption due to long debug output lines.

This happens for example at debug level DEBUG2 when
printing a received window icon (which is way more
than the 2k size of the buffer).