Fix history overflow
Fix history overflow

Closes #1867

dkm/gcc-explorer,dkm/gcc-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer,mattgodbolt/gcc-explorer,mattgodbolt/compiler-explorer,dkm/gcc-explorer,mattgodbolt/gcc-explorer,mattgodbolt/compiler-explorer,mattgodbolt/gcc-explorer,dkm/gcc-explorer,dkm/gcc-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer,mattgodbolt/compiler-explorer,mattgodbolt/gcc-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer,mattgodbolt/gcc-explorer,mattgodbolt/compiler-explorer,dkm/gcc-explorer,mattgodbolt/compiler-explorer