cmd/bench: don't overwrite err when cleaning up tmp dirs for sweet

Currently the sweet function doesn't properly propagate errors because
the error gets overwritten on a successful tmp dir clear. Fix this by
only overwriting the error if nothing else went wrong.

Change-Id: I4bda4a3d1d57fc307647bd5d2af8e4afcaec1de2
Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/384339
Reviewed-by: Michael Pratt <mpratt@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/cmd/bench/sweet.go b/cmd/bench/sweet.go
index f02b794..04d5d93 100644
--- a/cmd/bench/sweet.go
+++ b/cmd/bench/sweet.go
@@ -44,9 +44,11 @@
 		return fmt.Errorf("error creating temporary directory: %w", err)
 	}
 	defer func() {
-		err = removeAllIncludingReadonly(tmpDir)
-		if err != nil {
-			err = fmt.Errorf("error removing temporary directory: %w", err)
+		r := removeAllIncludingReadonly(tmpDir)
+		if err == nil && r != nil {
+			err = fmt.Errorf("error removing temporary directory: %w", r)
+		} else if err != nil && r != nil {
+			log.Printf("failed to clean up sweet temporary directory: %v", r)
 		}
 	}()
 	log.Printf("Sweet temporary directory: %s", tmpDir)