On "core:close" (ctrl/cmd-w), closes window if no files/panes left to close

Fixes #863