Fixed bug in the checkpoint writing code.
Fixed bug in the checkpoint writing code.

Exceptions would delete the checkpoint file rather
than the temporary file.
gcross/LogicGrowsOnTrees,gcross/LogicGrowsOnTrees