Fixed headless mode to save project file

Headless mode would create a project file, but not save it. Thus, it would not remember the workflow it was associated with. This has been corrected. A similar addition was added to the GUI version as well.