In prebuild_driver.tcl, explicitly closed infile when exiting on error.
In prebuild_driver.tcl, delayed opening outfile till actually required.
Outfile now explicitly closed even on error exits.