patch 8.0.0271: may get ml_get error when :tcldo deletes lines

Problem:    May get ml_get error when :tcldo deletes lines or switches to
            another buffer. (Nikolai Pavlov, closes #1421)
Solution:   Check the buffer and line every time.
diff --git a/src/testdir/test_tcl.vim b/src/testdir/test_tcl.vim
new file mode 100644
index 0000000..ac772cc
--- /dev/null
+++ b/src/testdir/test_tcl.vim
@@ -0,0 +1,23 @@
+" Tests for the Tcl interface.
+
+if !has('tcl')
+  finish
+end
+
+function Test_tcldo()
+  " Check deleting lines does not trigger ml_get error.
+  new
+  call setline(1, ['one', 'two', 'three'])
+  tcldo ::vim::command %d_
+  bwipe!
+
+  " Check switching to another buffer does not trigger ml_get error.
+  new
+  let wincount = winnr('$')
+  call setline(1, ['one', 'two', 'three'])
+  tcldo ::vim::command new
+  call assert_equal(wincount + 1, winnr('$'))
+  bwipe!
+  bwipe!
+endfunc
+