Handle code completion correctly with auto close braces on.

This fixes the scenario described in @TomMalbran's [comment](https://github.com/adobe/brackets/issues/6345#issuecomment-32548064).