Show alert sheet when closing window with a running command

This only applies to commands being run embedded in the document window.
Update API to reflect that setting command runner can’t fail
Do “refresh” for actions which are no-op due to current state

For example when caret is at the beginning of the document, using “move left” would be a no-op and would cause “refresh” to be skipped, which meant if the caret was outside the visible area, no scroll would happen (to make it visible).