patch 8.2.3624: when renaming a terminal buffer status text is not updated

Problem:    When renaming a terminal buffer the status text is not updated.
Solution:   Clear the cached status text when renaming a terminal buffer.
            (closes #9162)
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index cd7f477..62dfbf1 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -159,6 +159,18 @@
   bwipe Xasdfasdf
 endfunc
 
+func Test_terminal_rename_buffer()
+  let cmd = Get_cat_123_cmd()
+  let buf = term_start(cmd, {'term_name': 'foo'})
+  call WaitForAssert({-> assert_equal('finished', term_getstatus(buf))})
+  call assert_equal('foo', bufname())
+  call assert_match('foo.*finished', execute('ls'))
+  file bar
+  call assert_equal('bar', bufname())
+  call assert_match('bar.*finished', execute('ls'))
+  exe 'bwipe! ' .. buf
+endfunc
+
 func s:Nasty_exit_cb(job, st)
   exe g:buf . 'bwipe!'
   let g:buf = 0