Don't warn when trying to close a document when none are open

When using the document close keybinding, it is legitimate for the
callback to be called even if there are no documents open, so properly
check for this.

Closes [bugs:#941]