kranc: Don't rely on Mathematica exit code for detecting failure

When no licence is available, Mathematica still exits with a zero exit code.  This causes dependency-based systems such as Make to assume that the thorn was created successfully, when it might not have been.  To work around this, we perform a file operation (deleting a temporary directory) from within Mathematica, and check that this was successful after Mathematica finishes, and adjust the exit code of the script accordingly.

Fixes Issue #39.