Moved the bulk of exec to a new function in SaveSPE.

Created new macro to wrap fprintf so it throws an exception when it prints
nothing, so that when the write fails i can catch the exception, close the file and delete it
with the filename in scope.
Refs #1671
Added file remove functionality

File is now removed if the function throws as the file wasn't written
properly

Refs #1671
Fixed documentation and few style errors

Added proper documentation for the macro, and fixed some style problems not
caused by me.

Refs #1671
Merge branch 'bugfix/1671_disk_full_throw' into develop