Properly close abandoned new project that couldn't be written

Also rewrite the default session in case it was cleared.