Actually save the *modified* docs before running a tool

Fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=659437
Based on the analysis by Andrew Fountain