Add cleanup_on_error argument to tempdir