ace nits and warning cleanup

- switch to `session.doc.setValue()` when replacing changed file contents - this preserves the undo stack (as per https://github.com/dart-lang/chromedeveditor/issues/1698)
- fix a checked mode issue in ace.dart
- address an analysis warning

@ussuri, @umop 
The `_session.replace(new ace.Range(...` already was a fix for preserving the undo manager, but this is shorter => better. However, I'd prefer to keep the old comment, because it instructed the read about what *not to do*.