remove output directory if process fails #177

If an operation fails, the created output directory is no appropriately
removed.

Closes #177