red race

This hopefully fixes a race condition which you can create by typing Ctr/Cmd-S multiple times or by clicking the Save button rapidly.