file-marks: add synchronous variant of saving marks

This is useful for the shutdown case where we need to persist file-marks
back to the state file.
app: save file-marks on application shutdown.