Fix an occasional problem with the new CodeMirror optimizations.

We were throttling how often the 'change' event handler for CodeMirror
was getting invoked. However, this meant that there was a window of time
where CodeMirror could be closed/destroyed before the 'change' event
handler was called.

We now check for this and bail if CodeMirror is no longer with us.

Reviewed at https://reviews.reviewboard.org/r/6439/