Improvements to error handling.

Make sure we always clean up our temp dir, and give the user the ability to specify where it should be located.

Always report errors via the callback.