Do not reset input buffer on close

When chat window is closed the context buffer gets destroyed before
the reseting the buffer. This avoids invalid write.