This fix involved making two optimizations, rather than just scanning for windows messages more often:
1) When we reallocate combo_buff, we always at least double its size. This avoids a problem where we thrash the allocator by always reallocating the buffer to be one byte larger than the previous size. This changes the use of allocation to O(N) to O(log N).
2) Remove many calls to strlen(combo_buff) by adding combo_buff_length, and keeping it up-to-date. This changes the printing routine from being O(N^2) to O(N).