Fix auto-saving documents when the current document has no filename