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) in issue #6345.

@redmunds Can you review this?