Fix writing backspaces in input buf