Prompt to save modified items when closing a pane via pane:close

Fixes #4094