Moved INI file write

Moved writing the last run date to the INI file to the end.  Only
writing to the INI file if the run is successful.