Fixed double ESC bug

Sometimes after creating an auto pair, pressing ESC didn't leave
insert mode.