Fix two issues with 'window-deletable-p'
* lisp/window.el (window-deletable-functions): Clarify
doc-string.
(window-deletable-p): Handle check whether WINDOW's frame can be
deleted via new function 'frame-deletable-p' (a comparison with
the frame returned by 'next-frame' fails in too many cases). Do
not try to run 'window-deletable-functions' in WINDOW's buffer
when WINDOW is internal.
* lisp/frame.el (frame-deletable-p): New function.
* doc/lispref/frames.texi (Deleting Frames): Describe new
function 'frame-deletable-p'.
* etc/NEWS: Mention 'frame-deletable-p'.
(cherry picked from commit
bd647f361415d6c06913e4fa11a1a7ab6ab4ce02)