remove tmp dir on error and success