fix #12557 untitled score doesn't save (review needed)

This pull request tries to fix the fact that untitled scores are not saved (or, actually, saved in the folder where mscore starts, without mscz extension and without warnings for overwriting). It mimics the use of the GUI save button. For scores with parts, it first switches to the main score and then saves.