Improved check for readonly files when saving a solution

Don't crash if the file doesn't exist.