Don't try to store the selected document if it does not exist.

Before, we would try to store the selected document in a
tab list even if there was no selected document. This
typically occurred when a window was being closed via
Cmd-W after the last document was closed. When we tried
to do this, we'd try to stick a nil in an NSDictionaryl, which is
a no-no, and would short-circuit the whole project save
operation.

We now just leave out the selected document in those
cases, and things work as expected.