Slightly safer previous buffer implementation
Slightly safer previous buffer implementation

I suspect maybe this is occurring concurrently, but I can't
be sure. If that's the case, then there still may be more
bugs lurking here.

tjarratt/twIRCk,tjarratt/twIRCk,tjarratt/twIRCk