Simplify the code that checks if it's OK to close the current file

And make sure it gets called whenever it needs to get called - it was
missing from the openRecentFile case.

Fixes #530

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>