patch 8.1.2076: crash when trying to put a terminal in a popup window

Problem:    Crash when trying to put a terminal buffer in a popup window.
Solution:   Check for NULL buffer.  Do not allow putting a terminal in a popup
            window.
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 11e554f..dfdfc13 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -1992,6 +1992,12 @@
   call delete('XsomeFile')
 endfunc
 
+func Test_popupwin_terminal_buffer()
+  let ptybuf = term_start(&shell, #{hidden: 1})
+  call assert_fails('let winnr = popup_create(ptybuf, #{})', 'E278:')
+  exe 'bwipe! ' .. ptybuf
+endfunc
+
 func Test_popupwin_with_buffer_and_filter()
   new Xwithfilter
   call setline(1, range(100))